Exact Taylor sums by binary splitting #
Each Horner step is an affine map with integer coefficients and a positive common denominator. Composing adjacent blocks uses only integer arithmetic. Binary splitting balances the sizes of the multiplication operands, and rational normalization happens once, at the end.
The resulting exponential, logarithm and arctangent polynomials agree with their finite sums for every rational argument and every number of terms, without convergence assumptions.
The affine map tail ↦ (constantTerm + coefficient * tail) / denominator.
- constantTerm : ℤ
Integer constant in the numerator.
- coefficient : ℤ
Integer multiplier of the remaining polynomial tail.
- denominator : ℕ
Common denominator of the affine expression.
A positive denominator keeps every block evaluation defined.
Instances For
Apply a Horner block to the unevaluated tail of the polynomial.
Instances For
An empty block leaves the tail unchanged.
Instances For
Compose consecutive Horner blocks without reducing either fraction.
Instances For
The exponential Horner step tail ↦ 1 + x * tail / (k + 1).
Instances For
Exponential Horner steps expand into a sum with rising factorial denominators.
The logarithm Horner step tail ↦ x / (k + 1) + x * tail.
Instances For
The arctangent Horner step tail ↦ 1 / (2k + 1) - x ^ 2 * tail.
Instances For
Sum of the first n exponential terms, with one final rational normalization.
Instances For
Sum of the first n terms of -log (1 - x), with one final rational normalization.
Instances For
Sum of the first n arctangent terms, with one final rational normalization.