def sq_even

bend-collections-laws-crypto@1.0.0.0 · src/math/f64.bend:482

import bend-collections-laws-crypto@1.0.0.0/src/math/f64.bend as F64
import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W
import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as X

482# m * 2^(E - OFF - 1075) with the unbiased exponent made even (E odd); the
483# root of m * 2^72 has its top bit at 62
484def sq_even(+e: Nat, +m: W.U64) -> F64:
485  sq_root(Nat.add(Nat.div(Nat.sub(Nat.add(e, off()), 1075n), 2n), 1048n), X.shl(m, 8n))

Uses (9)

Used by (1)