def lemire_small
bend-collections-laws-crypto@1.0.0.0 · src/math/random/rand.bend:145
import bend-collections-laws-crypto@1.0.0.0/src/math/random/rand.bend as Rand
import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W
145
146
147def lemire_small(~S: Data, ~next: S -> W.U64 & S, +n: W.U64, +hi: W.U64, +lo: W.U64, s: S, small: Bool) -> W.U64 & S:
148 match small:
149 case False{}:
150 (hi, s)
151 case True{}:
152 result(S, retry(~S, ~next, 127n, n, thresh(n), D{hi, lo, s}))