Skip to main content

two_adic_reconstruct

Function two_adic_reconstruct 

Source
pub fn two_adic_reconstruct(bits: &[bool]) -> Option<(BigInt, BigInt)>
Expand description

Rational reconstruction of a bit sequence as a 2-adic number. Returns (p, q) with q odd and positive and p/q ≡ Σ sᵢ2ⁱ (mod 2ⁿ) — the shortest FCSR generating the sequence. None when no odd-denominator rational fits (an algorithmically-random sequence has no small FCSR).