TorchLean API

FloatLib.Floats.ExecFloat.Backends.Word.Narrow.ModelBridge

Native binary32 words and the generic model #

Field packing, decoding, and rounding of native binary32 words agree with the generic Model FloatFormat.binary32 representation. The operation proofs build on these facts, and Narrow.Agreement combines them into agreement of the finite operations.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.NativeBinary32.toUInt32_ofFields (sign : Bool) (exponent fraction : ℕ) :
toUInt32 (ofFields FloatFormat.binary32 sign exponent fraction) = mkBits sign exponent fraction

Native and generic binary32 field packing produce the same storage word.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.NativeBinary32.ofUInt32_mkBits (sign : Bool) (exponent fraction : ℕ) :
ofUInt32 (mkBits sign exponent fraction) = ofFields FloatFormat.binary32 sign exponent fraction

Rewrapping native field packing equals generic Model.ofFields.

Native and generic binary32 exponent extraction have the same natural-number value.

Native and generic binary32 fraction extraction have the same natural-number value.

Native and generic binary32 sign extraction agree.

Native and generic binary32 exponent zero tests agree.

Native and generic binary32 exceptional-exponent tests agree.

Native and generic binary32 fraction zero tests agree.

Native field extraction decodes the same exact dyadic as generic binary32.

The native signed-infinity word is the model's signed infinity.

Native rational rounding agrees with generic binary32 rational rounding.