def lemire
import bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand.bend as Randimport Base
59# Lemire: the product x * n = hi * 2^w + lo
60def lemire(+w: Nat, +n: Nat, +hi: Nat, +lo: Nat) -> Maybe<&2, Nat>:
61 accept(hi, Bool.not(Bool.and(Nat.is_lt(lo, n), Nat.is_lt(lo, pow2mod(w, n)))))
Uses (7)
Used by (5)
- bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand:draw_pos
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/lemire:draw_lemire
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/uint64n:dec
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/lemire:sum_lemire
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/lemire:term