def rnear
import bend-collections-laws-crypto@1.0.0.0/spec/math/f64.bend as F64import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/f64.bend as F
530def rnear(+s: Bool, +r: Nat, +b: Nat, +q: Nat, +u: Nat) -> F.F64:
531 pick(F.F64, rflip(r, b, q), round(Bool.not(s), Nat.sub(b, r), u), round(s, r, u))