#[non_exhaustive]pub enum Certified {
Certain {
sign: Sign,
precision: Precision,
},
Uncertain {
attempted: Precision,
},
}Expand description
A predicate evaluation that may or may not be trustworthy.
Uncertain is deliberately not a sign: it carries no Sign payload, so a
caller cannot accidentally read a value out of it. The only way to obtain a
Sign is to handle the uncertain case explicitly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Certain
The sign is proven at the reported precision.
Fields
Uncertain
The computed value was within its own error bound of zero, so the sign could not be determined at this precision. Escalate.
Implementations§
Source§impl Certified
impl Certified
Sourcepub fn from_filter(value: f64, error_bound: f64, precision: Precision) -> Self
pub fn from_filter(value: f64, error_bound: f64, precision: Precision) -> Self
Certify a value against a filter’s absolute error bound.
The bound is the maximum absolute error the computation may carry. If
zero lies inside value +- bound the sign is not decidable here, which
is the whole point of a filtered predicate: it reports failure instead
of guessing. A non-finite value or bound is never certifiable.
Sourcepub const fn exact_sign(sign: Sign) -> Self
pub const fn exact_sign(sign: Sign) -> Self
Certify an exact computation. Only valid where no rounding occurred.
An exact zero is a certain answer – the configuration is genuinely degenerate – which is different from being unable to decide. A sign established by exact arithmetic, where no integer value exists.
An exact predicate cascade produces a proven sign without producing a
representable magnitude: the determinant lives in a multi-term
expansion, not one i64. Without this constructor such a result could
only be reported as Uncertain, which would discard the very proof the
exact path was paid for.
pub const fn exact(value: i64) -> Self
Sourcepub const fn is_certain(self) -> bool
pub const fn is_certain(self) -> bool
Whether this result is safe to drive a topology decision.