1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! 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:
//!
//! 1. [`Interval`] arithmetic: `f64` with 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.
//! 2. Otherwise [`Dyadic`] arithmetic: a big-integer mantissa (`num-bigint`)
//! times a power of two. Every finite `f64` is 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 [`FixedInterval`]s 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.
pub use Arith;
pub use ;
pub use ;
pub use ;
pub use Dyadic;
pub use FixedInterval;
pub use Interval;
pub use ;
pub use ;
pub use ;