TorchLean API

FloatLib.Numerics.Enclosure.Interval.Runtime

Partial interval arithmetic on arbitrary endpoint carriers #

Exact endpoint calculations take place in an ordered field. A supplied OutwardRounding encodes the lower and upper results; failure is explicit rather than silently saturating an invalid enclosure. Binary, decimal, and posit adapters can instantiate the scalar field with exact rationals. No IEEE-specific exceptional values enter this layer.

def FloatLib.Numerics.OutwardRounding.checkedCandidates? {α : Type u_1} {β : Type u_2} [LinearOrder β] (decode : αOption β) (candidate : βInterval α) (x : β) :

Check candidate encodings against the exact scalar before accepting an enclosure.

Instances For
    def FloatLib.Numerics.OutwardRounding.ofCandidates {α : Type u_1} {β : Type u_2} [LinearOrder β] (decode : αOption β) (candidate : βInterval α) :

    Build a sound partial rounder from candidate endpoints and their exact decoder.

    The check also rejects overflowed, saturated-on-the-wrong-side, and exceptional results. Candidate generation may use a fast untrusted search; successful results carry checked bounds.

    Instances For

      Round the lower bound downward and the upper bound upward, with explicit failure.

      Instances For
        def FloatLib.Numerics.Interval.liftUnary? {α : Type u_1} {β : Type u_2} [LinearOrder β] (R : OutwardRounding α β) (f : Interval βInterval β) (I : Interval α) :

        Decode, apply an exact endpoint enclosure, and round outward.

        Instances For
          def FloatLib.Numerics.Interval.liftBinary? {α : Type u_1} {β : Type u_2} [LinearOrder β] (R : OutwardRounding α β) (f : Interval βInterval βInterval β) (I J : Interval α) :

          Decode two intervals, apply an exact endpoint enclosure, and round outward.

          Instances For
            def FloatLib.Numerics.Interval.neg? {α : Type u_1} {β : Type u_2} [Field β] [LinearOrder β] (R : OutwardRounding α β) (I : Interval α) :

            Outward-rounded negation, exchanging the endpoints.

            Instances For
              def FloatLib.Numerics.Interval.add? {α : Type u_1} {β : Type u_2} [Field β] [LinearOrder β] (R : OutwardRounding α β) (I J : Interval α) :

              Outward-rounded addition; missing finite interpretations and overflow return none.

              Instances For
                def FloatLib.Numerics.Interval.sub? {α : Type u_1} {β : Type u_2} [Field β] [LinearOrder β] (R : OutwardRounding α β) (I J : Interval α) :

                Outward-rounded subtraction.

                Instances For
                  def FloatLib.Numerics.Interval.mul? {α : Type u_1} {β : Type u_2} [Field β] [LinearOrder β] (R : OutwardRounding α β) (I J : Interval α) :

                  Outward-rounded four-corner multiplication.

                  Instances For
                    def FloatLib.Numerics.Interval.div? {α : Type u_1} {β : Type u_2} [Field β] [LinearOrder β] (R : OutwardRounding α β) (I J : Interval α) :

                    Outward-rounded four-corner division, defined only away from a zero-crossing denominator.

                    The generic endpoint carrier need not represent unbounded intervals, so a denominator that does not lie strictly on one side of zero returns none.

                    Instances For