TorchLean API

FloatLib.Floats.ExecFloat.Backends.Word.Narrow.Agreement

Agreement between native binary32 words and the generic model #

The narrow-word core implements finite binary32 arithmetic with UInt32 and UInt64. This module proves that its finite operations equal the generic Model FloatFormat.binary32 formulas, using the field, decoding and rounding bridge of Narrow.ModelBridge.

The Addition, Multiplication and Fma proof modules connect their word kernels to these finite operations. Runtime clients can import the Runtime modules without these proofs.

Native finite binary32 addition rounds the generic exact dyadic sum.

Native finite binary32 multiplication equals the generic product, zero factors included.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.NativeBinary32.fmaFinite_eq (x y z : Value) :
fmaFinite? x y z = match Model.toDyadic? x, Model.toDyadic? y, Model.toDyadic? z with | some dx, some dy, some dz => have product := { negative := dx.negative ^^ dy.negative, significand := dx.significand * dy.significand, exponent := dx.exponent + dy.exponent }; some (Model.roundDyadic FloatFormat.binary32 (addDyadic product dz)) | x, x_1, x_2 => none

Native finite binary32 fused multiply-add rounds the exact product plus addend once.