Expand description
Rational reconstruction — turns the original engine’s worst failure mode
(silent aliasing mod M) into a clean, checkable event.
Given a residue x = value mod M, recover the unique reduced p/q with
|p|, |q| <= sqrt(M/2) such that p ≡ q·x (mod M). When no such fraction
exists within the bound, the basis was too small: the caller extends it and
retries (see crate::basis::Basis::extend_to_bits).
Functions§
- balanced_
lift - Balanced (symmetric) lift of
x mod minto(-m/2, m/2]. - rational_
reconstruct - Recover the unique reduced
p/qwith|p|, |q| <= sqrt(M/2)andp ≡ q·x (mod M), orNoneif none exists within the bound.