TorchLean API

NN.Floats.Interval.Comparison

Comparison helpers for executable interval examples #

This module contains small, reusable baselines for numerical-audit examples:

FloatLib supplies the interval arithmetic and its proofs. This module provides baselines that make examples and regression tests easier to read.

def TorchLean.Floats.Interval.Comparison.formatValue {α β : Type} [ToString α] [ToString β] (bits : α → β) (x : α) :

Pretty-print a scalar together with its raw encoding.

Instances For

    Pretty-print endpoints using a scalar renderer.

    Instances For
      @[inline]

      +0.0f by IEEE-754 binary32 bits.

      Instances For
        @[inline]

        -0.0f by IEEE-754 binary32 bits.

        Instances For
          @[inline]

          +∞ by IEEE-754 binary32 bits.

          Instances For
            @[inline]

            -∞ by IEEE-754 binary32 bits.

            Instances For
              @[inline]

              Naive endpoint addition; no directed rounding.

              Instances For
                @[inline]

                Naive endpoint subtraction; no directed rounding.

                Instances For

                  Classical four-corner multiplication in the endpoint carrier; no directed rounding.

                  Instances For
                    @[inline]

                    Conservative fallback interval [-∞, +∞].

                    Instances For

                      Return true iff the interval contains zero, including signed-zero endpoints.

                      Instances For

                        Naive four-corner division when the denominator does not contain zero.

                        If the denominator straddles zero, return whole, mirroring the shape of Binary.Interval.div but without directed rounding.

                        Instances For

                          Classical four-corner multiplication over exact rationals.

                          Instances For

                            Boolean check that outer contains inner.

                            Instances For

                              Pretty-print an exact rational interval.

                              Instances For

                                Decode rational endpoints, preserving the decoder's special-value policy on failure.

                                Instances For
                                  def TorchLean.Floats.Interval.Comparison.endpoints {α : Type} [Min α] [Max α] (f : α → α) (lo hi : α) :

                                  Endpoint-evaluate a unary function, using the carrier's minimum and maximum.

                                  This is not a sound transcendental interval rule in general; it is a comparison baseline for examples.

                                  Instances For