TorchLean API

FloatLib.Numerics.Enclosure.Rational.Runtime

Executable rational intervals #

The endpoints stay rational throughout a calculation, with no rounding in these operations. Callers use the bounds to compare an exact value with rounding boundaries or to establish a unique rounded result. Soundness over the reals is proved in Rational.Proof.

An interval may be empty: the carrier records endpoints without enforcing their order. Membership hypotheses supply the required ordering in proofs.

Closed rational endpoints used to enclose a real value.

  • lo :

    Lower endpoint.

  • hi :

    Upper endpoint.

Instances For

    The degenerate interval containing one rational value.

    Instances For

      An interval described by its midpoint and absolute-error radius.

      Instances For

        Negation reverses the endpoints.

        Instances For

          Exact endpoint addition.

          Instances For

            Exact endpoint subtraction.

            Instances For

              Multiply both endpoints by a nonnegative rational scale.

              Instances For

                Exact rational scaling, reversing the endpoints when the factor is negative.

                Instances For

                  Square an interval known to contain a nonnegative value.

                  Clamping the lower endpoint at zero avoids squaring a negative error bound. This operation is used in exponential range reduction, where positivity follows from the function being enclosed.

                  Instances For

                    Repeated squaring of a nonnegative enclosure.

                    Instances For