TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.DirectedSemantics.FiniteBounds

Range-limited directed bounds for finite-only binary formats #

Every word of an Encoding.finite descriptor denotes a finite real. Outward rounding therefore has a real enclosure contract exactly while the exact value lies between the largest negative and positive finite values. Unlike the IEEE theorem, no infinity is available outside that range.

These results are specific to Encoding.finite. Formats using Encoding.finiteMaxNaN or Encoding.finiteUnsignedZero reserve exceptional words and need their own boundary arguments.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.toReal_roundDyadicPosDown_le_of_encoding_finite (fmt : FloatFormat) (mantissa : ) (exponent : ) (hfmt : fmt.encoding = FloatFormat.Encoding.finite) (hm : mantissa 0) :
(roundDyadicPosDown fmt mantissa exponent).toReal mantissa * bpow exponent

Positive downward rounding in a finite-only format is a real lower bound.

theorem FloatLib.Floats.Formats.BinaryInterchange.Model.le_toReal_roundDyadicPosUp_of_encoding_finite (fmt : FloatFormat) (mantissa : ) (exponent : ) (hfmt : fmt.encoding = FloatFormat.Encoding.finite) (hm : mantissa 0) (hbound : mantissa * bpow exponent (posMaxFinite fmt).toReal) :
mantissa * bpow exponent (roundDyadicPosUp fmt mantissa exponent).toReal

Within the largest-finite range, positive upward rounding in a finite-only format is a real upper bound. Outside that range the executable operation saturates, so no such theorem is possible.

Range-limited downward rounding of an exact dyadic is a real lower bound in a finite-only format.

Range-limited upward rounding of an exact dyadic is a real upper bound in a finite-only format.

Range-limited downward addition is a real lower bound in a finite-only format.

Range-limited upward addition is a real upper bound in a finite-only format.

Range-limited downward subtraction is a real lower bound in a finite-only format.

Range-limited upward subtraction is a real upper bound in a finite-only format.

Range-limited downward multiplication is a real lower bound in a finite-only format.

Range-limited upward multiplication is a real upper bound in a finite-only format.