def rd

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/f64rtools.bend:125

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64rtools.bend as F64rtools
import Base
import bend-collections-laws-math@1.0.0.0/spec/math/f64.bend as SF
import bend-collections-laws-math@1.0.0.0/src/math/f64.bend as F
import bend-collections-laws-math@1.0.0.0/src/math/natural.bend as M

125# SF.round, SF.round_u and SF.pick unfolded once, over variables: proofs
126# rewrite with these instead of letting a conversion unfold (and normalize)
127# the rounding on both sides
128def rd(+s: Bool, +m: Nat, +x: Nat) -> {SF.round(s, m, x) == SF.pick(F.F64, Nat.is_eq(m, 0n), SF.zero(s), SF.round_u(s, m, x, Nat.max(Nat.sub(Nat.add(x, M.bit_length(m)), 53n), Nat.sub(SF.zb(), 1074n)))) : F.F64}:
129  {==}

Uses (13)

Used by (1)