Expand description
Filtered exact arithmetic (ADR 0068).
Exact constructions – where two segments cross, where a line meets a
circle – produce numbers f64 cannot hold. This crate answers each sign
question in at most two passes over the same expression:
Intervalarithmetic:f64with every operation rounded outward, so the true value is provably inside[lo, hi]. If zero is outside, the sign is proven. This decides almost every real input.- Otherwise
Dyadicarithmetic: a big-integer mantissa (num-bigint) times a power of two. Every finitef64is one, and+ - *stay exact, so the sign is exact.
There is no division, by design: constructions clear denominators, and a
quotient’s sign is sign(numerator) * sign(denominator). Square roots
appear only inside Root2, the value (a + b*sqrt(c)) / d, whose sign
and order are decided by squaring with case analysis, never by
evaluating the root.
Values no finite arithmetic holds – sin and cos of a dyadic angle
– are enclosed in FixedIntervals whose precision the caller raises
until a nonzero sign shows.
Expressions are written once against the Arith trait and run in both
tiers, so the fast path and the exact path cannot compute different
polynomials.
Re-exports§
pub use arith::Arith;pub use certify::certify;pub use certify::filter;pub use certify::require_finite;pub use certify::ExactError;pub use certify::SignExpr;pub use conic::conic_intersections;pub use conic::line_conic_hits;pub use conic::Conic;pub use conic::ConicIntersection;pub use conic::ConicLineHit;pub use conic::ConicLineHits;pub use conic::ConicPoint;pub use construct::compare_along;pub use construct::crossing_orientation;pub use construct::crossing_orientation_filter;pub use construct::line_circle_hits;pub use construct::Branch;pub use construct::Circle;pub use construct::HitCount;pub use construct::Line;pub use construct::LineHit;pub use dyadic::Dyadic;pub use fixed::FixedInterval;pub use interval::Interval;pub use poly::IntPoly;pub use poly::RealRoot;pub use root::sign_root;pub use root::sign_two_roots;pub use root::Root2;pub use tower::Nested;pub use tower::Tower;
Modules§
- arith
- The arithmetic both evaluation tiers share.
- certify
- The two-tier driver: interval filter first, exact fallback second.
- conic
- Conics: exact line/conic and conic/conic intersection.
- construct
- Exact constructions over
f64inputs, decided without division. - dyadic
- Dyadic rationals: the exact tier.
- fixed
- Fixed-point intervals at a chosen precision, with certified
sinandcos: the tier for values no finite arithmetic holds exactly. - interval
- Outward-rounded interval arithmetic: the fast tier.
- poly
- Integer polynomials and exact real-root isolation.
- root
- Numbers of the form
(a + b*sqrt(c)) / d. - tower
- Nested square roots: values in a tower of adjoined radicals.