def sm_exact3
import bend-collections@1.0.0.0/src/math/f64.bend as F64import Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
import bend-collections@1.0.0.0/src/math/w64.bend as X
266def sm_exact3(+s: Bool, +e1: Nat, +d: W.U64, +sd: Nat, under: Bool) -> F64:
267 match under:
268 case True{}:
269 pack(s, 0n, X.shl(d, e1))
270 case False{}:
271 pack(s, Nat.sub(e1, sd), X.shl(d, sd))