TorchLean API

FloatLib.Floats.Formats.Flocq.Calculation.Operations

Exact Operations on Mantissa/Exponent Values #

These operations manipulate FloatRep representations without rounding. Addition aligns both operands to their smaller exponent; multiplication adds exponents. Their correctness theorems are radix-parametric counterparts of Flocq's Calc.Operations results.

Integer radix powers agree with real radix powers at nonnegative exponents.

Two integer mantissas expressed on a common exponent grid.

  • leftMantissa :

    First aligned mantissa.

  • rightMantissa :

    Second aligned mantissa.

  • exponent :

    Common exponent, equal to the smaller input exponent.

Instances For

    Align two representations to the smaller exponent without changing their real values.

    Instances For
      theorem FloatLib.Floats.Formats.Flocq.FloatRep.align_toReal {β : Numerics.Radix} (f g : FloatRep β) :
      toReal f = toReal { mantissa := (f.align g).leftMantissa, exponent := (f.align g).exponent } toReal g = toReal { mantissa := (f.align g).rightMantissa, exponent := (f.align g).exponent }

      Alignment preserves both represented real values.

      Alignment selects the minimum input exponent.

      @[inline]

      Exact negation of a mantissa/exponent representation.

      Instances For

        Exact absolute value of a mantissa/exponent representation.

        Instances For

          Exact addition after exponent alignment.

          Instances For

            Exact subtraction after exponent alignment.

            Instances For
              @[inline]

              Exact multiplication of mantissas with exponent addition.

              Instances For
                @[simp]

                Exact representation negation denotes real negation.

                @[simp]

                Exact representation absolute value denotes real absolute value.

                @[simp]

                Exact aligned addition denotes real addition.

                @[simp]

                Exact aligned subtraction denotes real subtraction.

                @[simp]

                Exact mantissa/exponent multiplication denotes real multiplication.