TorchLean API

FloatLib.Floats.ExecFloat.Backends.WideLimb.Finite.Proof

From the compact finite kernels to the reference operations #

The wide-limb kernels prove that an accepted result is the compact finite kernel (FiniteKernel.add?, mul?, or fma?) on the operand models. This module supplies the last step of each refinement: whenever a compact finite kernel accepts its operands, the reference operation Model.Spec.add, mul, or fma returns the same value (spec_add_of_add?_eq_some and its siblings). It also records that negating a model value flips only the decoded sign (decode?_neg) and that the unsigned-scale sum is commutative (roundSum_comm), which the alignment kernel uses to order its operands by scale.

An accepted compact finite addition is the reference addition.

An accepted compact finite multiplication is the reference multiplication.

An accepted compact finite fused multiply-add is the reference fused multiply-add.

Negating a conventional IEEE value flips only the decoded sign.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.WideLimb.roundSum_comm {fmt : FloatFormat} (hieee : fmt.isIEEE = true) (roundOffset : ) (aSign bSign : Bool) (a sa b sb : ) :
FiniteScaleAdd.roundSum fmt roundOffset aSign bSign a sa b sb = FiniteScaleAdd.roundSum fmt roundOffset bSign aSign b sb a sa

The unsigned-scale exact sum does not depend on the order of its operands.