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, so no rounded approximation to π enters the argument reduction.
The arctangent partial sums are evaluated by binary splitting with one final normalization. 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 Taylor coefficients follow the NIST Digital Library of Mathematical Functions:
§4.19.E1 for sine,
§4.19.E2 for cosine, and
§4.24.E3 for arctangent.
SinCosProof proves the remainder bounds using Mathlib's Taylor theorem. AtanProof bounds
the arctangent tail by a geometric series and uses Mathlib's Machin identity to enclose π/4.
Sum of the first n terms of the arctangent series, in exact rational arithmetic.
Instances For
The arctangent Taylor sum equals its evaluation by binary splitting.
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
Enclose atan x for x in [0, 1], with a series argument of magnitude at most one half.
Instances For
Enclose atan x for nonnegative x, inverting arguments above one into [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
Sine Taylor polynomial through degree, with exact rational coefficients.
Instances For
Cosine Taylor polynomial through 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, because this baseline performs no reduction by an approximate multiple of π.
Instances For
Enclose cosine globally and intersect the Taylor bounds with its real range.