def and_bits
import bend-collections-laws-math@1.0.0.0/spec/math/random/rand.bend as Randimport Base
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as C
38def and_bits(w: Nat, +a: Nat, +b: Nat) -> Nat:
39 match w:
40 case 0n:
41 0n
42 case 1n+k:
43 Nat.add(Nat.mul(C.bit(a), C.bit(b)), Nat.double(and_bits(k, C.half(a), C.half(b))))
Uses (6)
Used by (42)
- bend-collections-laws-math@1.0.0.0/spec/math/random/rand:draw
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:cm
- bend-collections-laws-math@1.0.0.0/spec/math/random/rand:draw_pos
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:cm2
- bend-collections-laws-math@1.0.0.0/proofs/math/random/uint64n:hd_of
- …