TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Configured.NativeFPU.Runtime

Direct-carrier software FMA for binary32 and binary64 #

These binary32 and binary64 FMA entry points execute the proved fixed-word kernel in both Lean's logic and compiled code, with carrier conversion fixed statically. Addition, subtraction, multiplication, division, and square root use the generic configured Backend.word* entry points.

Guarded Float32 and Float experiments live in the separate Configured.NativeFPU.Unchecked module. Importing this runtime does not expose them or pull native floating-point primitives into certified clients.

Binary32 #

@[reducible, inline]

Configured IEEE binary32 value stored in a direct UInt32 carrier.

Instances For

    Every UInt32 bit pattern fits the complete binary32 interchange width.

    @[inline]

    Rewrap one complete binary32 interchange word in its configured carrier.

    Instances For

      Direct-carrier fused multiply-add #

      @[inline]

      Proved software binary32 FMA with the UInt32 carrier adapter fixed statically.

      This uses the proved fixed-word FMA kernel. Spelling the carrier conversion directly avoids retaining a ModelCodec structure and four indirect closure applications in compiled monomorphic code.

      Instances For

        Binary64 #

        @[reducible, inline]

        Configured IEEE binary64 value stored in a direct UInt64 carrier.

        Instances For

          Every UInt64 bit pattern fits the complete binary64 interchange width.

          @[inline]

          Rewrap one complete binary64 interchange word in its configured carrier.

          Instances For

            Direct-carrier fused multiply-add #

            @[inline]

            Proved software binary64 FMA with the UInt64 carrier adapter fixed statically.

            As for binary32, the arithmetic uses the proved fixed-word kernel. The specialization exists to make carrier conversion first-order in generated code, independently of the generic codec used by arbitrary configured formats.

            Instances For