TorchLean API

FloatLib.Floats.ExecFloat.Backends.Word.Narrow.Base.Runtime

Native binary32 storage and rounding primitives #

Model FloatFormat.binary32 remains the theorem-facing representation. Narrow-word kernels share a UInt32 view, direct field operations, exact finite decoding, and rounding primitives defined here.

Operation-specific kernels and their refinements live in sibling modules. Keeping this base small prevents representation-only clients from importing the much larger addition and fused-operation proof developments.

References #

@[reducible, inline]

The generic binary32 carrier.

Instances For
    @[inline]

    View generic binary32 storage as a native word.

    Instances For
      @[inline]

      Rewrap a native binary32 word in the generic carrier.

      Instances For

        Native storage operations

        @[inline]

        Toggle the binary32 sign bit without passing through generic BitVec arithmetic.

        Instances For
          @[inline]

          Extract the binary32 sign from a native word.

          Instances For
            @[inline]

            Extract the binary32 biased exponent from a native word.

            Instances For
              @[inline]

              Extract the binary32 fraction from a native word.

              Instances For
                @[inline]

                Decode a finite binary32 native word to the generic exact dyadic representation.

                Instances For
                  @[inline]

                  Convert natural-number fields to native words, then mask and pack the binary32 fields.

                  Instances For
                    @[inline]

                    Round an exact dyadic to a native binary32 word, using nearest-even rounding.

                    Instances For
                      @[inline]

                      Round the signed magnitude (num / den) * 2^exponent to a native binary32 word; a zero denominator produces canonical NaN.

                      The exact quotient calculations remain format-independent natural-number arithmetic. Only the binary32 thresholds and final field packing are specialized.

                      Instances For