Elementary enclosures evaluated on a binary grid #
Taylor polynomials and remainder bounds use integer interval arithmetic at precision fractional
bits. Each multiplication and scalar division rounds outward on that grid. Argument reduction and
scalar factors use exact rational arithmetic, and only the final endpoints are decoded.
The degree selects the same Taylor polynomial as the rational kernels in Elementary.Runtime.
Containment holds at every degree and precision, including zero, so the precision and degree
estimates below guide refinement and never affect soundness. Coarse grids can give wide bounds.
Long logarithm polynomials share a table of powers through rectangular splitting, as in Section 4 of Fredrik Johansson, Efficient implementation of elementary functions in the medium-precision range.
Add guard bits and a degree-dependent rounding allowance to a target grid width.
Instances For
Choose a grid width relative to a nonzero result scale.
The integer logarithms estimate the extra fractional bits needed for a small result. Consumers handle exact zero themselves. A higher degree also raises the rounding allowance.
Instances For
Allow for repeated squaring and small exponential results when choosing a grid width.
Subtracting one also needs enough fractional bits to retain a small input's contribution.
Instances For
Decode the two final coefficients as rational endpoints.
Instances For
divideNat equals the integer floor and ceiling division that compiled code runs.
Grid multiplication equals Internal.mul, which needs two products for a point factor.
Exponential Horner evaluation equals the accumulator loop that compiled code runs.
Odd logarithm Horner evaluation equals the accumulator loop that compiled code runs.
Balance Taylor work against extra squarings using the degree and requested grid width.
The square-root estimate limits squaring work while the degree is small, and the quotient reduces it as refinement raises the degree. A small input already supplies some reduction without squaring.
Instances For
Enclose the exponential, with extra grid bits to cover the extra range-restoring squares.
Instances For
A logarithm series degree for a positive value whose truncation error is below about
2 ^ -bits.
For value = n / d in lowest terms the series runs in t = (n - d) / (n + d), so each pair of
degrees gains log₂ (1 / t²) bits. The estimate uses the integer part of 1 / t².
Instances For
Enclose the logarithm of a positive rational, inverting arguments below one before reduction.