Documentation

Linglib.Core.Interval.PadeExp

PadeExp — Padé Approximant for exp(x) with Interval Bounds #

[4/4] Padé approximant for exp(x) on [-1, 1], with argument reduction for arbitrary x ∈ ℝ. The approximant has relative error < 10⁻⁷ on [-1,1], so the error bound 1/4000000 provides a 2.3× safety margin.

Strategy #

For small |x| ≤ 1: exp(x) ≈ padeNum(x) / padeDen(x) (within padeErrorBound)

For large |x|:

  1. Choose k so x/2^k ∈ [-1, 1]
  2. Compute exp(x/2^k) via Padé
  3. Square k times: exp(x) = exp(x/2^k)^(2^k)

Padé [4/4] numerator: 1 + x/2 + 3x²/28 + x³/84 + x⁴/1680 (Horner form).

Equations
Instances For

    Padé [4/4] denominator: padeNum(-x).

    Equations
    Instances For

      Padé [4/4] approximant: padeNum(x) / padeDen(x).

      Equations
      Instances For

        Conservative error bound for Padé [4/4] on [-1, 1]. True error is ~4.3×10⁻⁸; this bound gives 2.3× safety margin.

        Equations
        Instances For
          theorem Linglib.Interval.pade_error_bound (q : ) (hq_lo : -1 q) (hq_hi : q 1) (hden_pos : 0 < padeDen q) :

          The Padé [4/4] approximant is within padeErrorBound of exp on [-1, 1].

          Proof via triangle inequality: |exp(q) - P(q)/Q(q)| ≤ |exp(q) - T₁₀(q)| + |T₁₀(q) - P(q)/Q(q)| where T₁₀ is the degree-10 Taylor polynomial. The first term is bounded by Real.exp_bound with n = 11 (≤ 1/36590400 ≈ 2.73×10⁻⁸). The second term equals |T₁₀·Q - P|/Q; the numerator is a polynomial with terms only at degrees 9-14 (Padé matching property), bounded by 187/2032128000 ≈ 9.2×10⁻⁸ via coefficient sum, and Q ≥ 143/240.

          Number of halvings needed so q / 2^k ∈ [-1, 1].

          Equations
          Instances For

            Repeated squaring of a nonneg interval. Squares I a total of n times: repeatedSq I 0 = I, repeatedSq I (n+1) = (repeatedSq I n)².

            Equations
            Instances For
              theorem Linglib.Interval.repeatedSq_nonneg (I : QInterval) (n : ) (h : 0 I.lo) :
              0 (repeatedSq I n h).lo

              Point interval containing exp(q) for arbitrary rational q.

              Strategy: reduce q → q' = q/2^k with |q'| ≤ 1 via reductionSteps, compute exp(q') via Padé [4/4], then square k times since exp(q) = exp(q')^(2^k).

              The nonneg guard on small.lo is always true by construction: padeExp(q') ≈ exp(q') ≥ exp(-1) ≈ 0.368 >> padeErrorBound = 2.5×10⁻⁷.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Containment theorem for expPoint.

                Interval containing exp(x) for x in rational interval I.

                Uses monotonicity of exp: for x ∈ [lo, hi], exp(lo) ≤ exp(x) ≤ exp(hi) so exp(x) ∈ [expPoint(lo).lo, expPoint(hi).hi].

                Equations
                Instances For

                  Containment theorem for expInterval: monotonicity of exp + expPoint containment.