TorchLean API

FloatLib.Numerics.Enclosure.Trigonometric.Runtime

Rational trigonometric enclosures #

The arctangent series is evaluated only for arguments in (-1, 1). Inversion and the arctangent addition identity at π/4 reduce every rational input to a series argument of magnitude at most one half. Machin's identity π / 4 = 4 * atan (1/5) - atan (1/239) supplies a rational enclosure of the constant; no rounded approximation to π enters the argument reduction.

The natural argument controls the number of terms. These operations return rational bounds, not rounded floating-point values. In particular, containment and convergence alone do not assert termination of a rounding search at an exact rounding boundary.

These kernels provide analytic foundations for the trigonometric functions listed in §5.5 of the Posit Standard (2022); they do not by themselves implement that section's rounding contract.

The first n terms of the arctangent series, evaluated exactly.

Instances For

    A geometric majorant of the arctangent tail, valid for |x| < 1.

    Instances For

      A rational enclosure of the arctangent on its open series domain.

      Instances For

        A rational enclosure of π/4 using Machin's rapidly convergent arctangent identity.

        Instances For

          Reduce an argument in [0, 1] to magnitude at most one half.

          Instances For

            Inversion reduces a nonnegative rational argument to [0, 1].

            Instances For

              Enclose the arctangent of any rational argument, using oddness for negative inputs.

              Instances For

                The nth derivative of sine at zero: alternating signs on odd indices and zero otherwise.

                Instances For

                  The nth derivative of cosine at zero: alternating signs on even indices and zero otherwise.

                  Instances For

                    The sine Taylor polynomial through the requested degree, with exact rational coefficients.

                    Instances For

                      The cosine Taylor polynomial through the requested degree.

                      Instances For

                        Global Lagrange remainder bound, since every sine and cosine derivative is bounded by one.

                        Instances For

                          Intersect a trigonometric enclosure with the known range [-1, 1].

                          Instances For

                            Enclose sine at any rational argument using the global Taylor remainder.

                            The bound is valid even when the degree is too small to be informative. Large arguments can require large degrees; this baseline performs no reduction by an approximate multiple of π.

                            Instances For

                              Enclose cosine globally and intersect the Taylor bounds with its real range.

                              Instances For