TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.DirectedSemantics.Signed

Signed directed rounding for arbitrary executable float formats #

Signed floor and ceiling semantics follow from the positive scaled-mantissa results. For negative inputs, downward rounding uses the upward-rounded magnitude and upward rounding uses the downward-rounded magnitude. The final theorems lift these integer identities through round to exact real equations for nonzero dyadics when fmt.isIEEE = true.

Signed scaled mantissas #

Signed mantissa selected by rounding a dyadic toward negative infinity.

Instances For

    Signed mantissa selected by rounding a dyadic toward positive infinity.

    Instances For
      theorem FloatLib.Floats.Formats.BinaryInterchange.Model.floor_scaledDyadic (sign : Bool) (mantissa : ) (exponent targetExponent : ) :
      Flocq.floorRound ((if sign = true then -1 else 1) * mantissa * Flocq.bpow Numerics.binaryRadix (exponent - targetExponent)) = roundSignedMantissaAtExponentDown sign mantissa exponent targetExponent

      Signed floor rounding swaps to ceiling on the magnitude of a negative dyadic.

      theorem FloatLib.Floats.Formats.BinaryInterchange.Model.ceil_scaledDyadic (sign : Bool) (mantissa : ) (exponent targetExponent : ) :
      Flocq.ceilRound ((if sign = true then -1 else 1) * mantissa * Flocq.bpow Numerics.binaryRadix (exponent - targetExponent)) = roundSignedMantissaAtExponentUp sign mantissa exponent targetExponent

      Signed ceiling rounding swaps to floor on the magnitude of a negative dyadic.

      Numerics.Dyadic rounded-real semantics #

      Rounded-real semantics of upward rounding for a nonzero signed dyadic.