TorchLean API

FloatLib.Floats.Formats.Posit.Arithmetic.Dyadic.Direct.Runtime

Direct arbitrary-width exact-dyadic posit arithmetic #

Direct posit arithmetic combines shared exact-dyadic operand decoding and integer arithmetic with construction of the standard regime/exponent/fraction stream. It is the width-generic executable tier used after fixed packed storage ends.

Division uses a destination-width quotient prefix, one exact remainder test, and direct guard/sticky packing. Square root uses one destination-width integer-root prefix and one exact square-remainder sticky bit. Refinement theorems live in Direct.Proof.

@[noinline]

Exact dyadic addition followed by certified direct result packing.

Instances For
    @[noinline]

    Exact dyadic subtraction followed by certified direct result packing.

    Instances For
      @[noinline]

      Exact integer multiplication followed by certified direct result packing.

      Instances For
        @[inline]

        Apply the shared quotient-prefix kernel to two already-decoded operands.

        Keeping exceptional-value dispatch at this boundary lets every storage representation reuse the same division implementation after supplying its proved decoder.

        Instances For
          @[noinline]

          Correctly rounded division using one destination-width quotient prefix and exact remainder rounding.

          Instances For
            @[noinline]

            Correctly rounded square root using one integer-root prefix and exact sticky bit.

            Instances For
              @[noinline]
              def FloatLib.Floats.Formats.Posit.Model.DirectDyadicArithmetic.fma {format : Format} (left right addend : Model format) :
              Model format

              Exact fused multiply-add with one certified direct final packing step.

              Instances For