def small2
import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as W64import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W
700# a and b fit 48 bits (runtime Nats) and a has more than 16: the binary gcd
701# then hands them to Euclid on Nat (native division); below 2^16 its few
702# steps are cheaper
703def small2(+a: W.U64, +b: W.U64) -> Bool:
704 Bool.and(Bool.and(U32.is_lt(hi(a), 65536), U32.is_lt(hi(b), 65536)), Bool.or(Bool.not(U32.is_zero(hi(a))), U32.is_lt(65535, lo(a))))