def isqrt_pick
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
512def isqrt_pick(+n: W.U64, small: Bool) -> W.U64:
513 match small:
514 case True{}:
515 W.U64{isqrt32(lo(n)), 0}
516 case False{}:
517 isqrt_big(n, isqrt_est(F32.sqrt(F32.add(F32.mul(U32.to_f32(hi(n)), 4294967296.0), U32.to_f32(lo(n))))))