[Paper Review] Optimizing polynomials for floating-point implementation
This paper presents a modified Remez algorithm that optimizes polynomial approximations for floating-point implementation by forcing small coefficients to zero, reducing both computational cost and numerical cancellation. The method uses a black-box function interface and targets an incomplete monomial basis, yielding more efficient and numerically stable polynomials than standard minimax approximation.
The floating-point implementation of a function on an interval often reduces to polynomial approximation, the polynomial being typically provided by Remez algorithm. However, the floating-point evaluation of a Remez polynomial sometimes leads to catastrophic cancellations. This happens when some of the polynomial coefficients are very small in magnitude with respects to others. In this case, it is better to force these coefficients to zero, which also reduces the operation count. This technique, classically used for odd or even functions, may be generalized to a much larger class of functions. An algorithm is presented that forces to zero the smaller coefficients of the initial polynomial thanks to a modified Remez algorithm targeting an incomplete monomial basis. One advantage of this technique is that it is purely numerical, the function being used as a numerical black box. This algorithm is implemented within a larger polynomial implementation tool that is demonstrated on a range of examples, resulting in polynomials with less coefficients than those obtained the usual way.
Motivation & Objective
- To address numerical instability in floating-point polynomial evaluation caused by catastrophic cancellation due to large coefficient magnitude disparities.
- To reduce the number of operations in polynomial evaluation by eliminating small or negligible coefficients.
- To generalize symmetry-based coefficient pruning (e.g., for odd/even functions) to a broader class of functions without requiring analytical knowledge of symmetry.
- To develop a purely numerical method that works with functions provided as black boxes, without symbolic manipulation.
- To improve the practicality and accuracy of polynomial-based elementary function implementations in floating-point arithmetic.
Proposed method
- Adapts the Remez algorithm to minimize error over an incomplete monomial basis, where certain monomials are excluded (i.e., their coefficients are forced to zero).
- Uses a numerical approach that treats the target function as a black box, requiring only function evaluation and derivative access.
- Applies a modified error minimization criterion that accounts for the absence of selected monomials in the basis, ensuring optimal approximation under the constraint.
- Employs Horner’s scheme for evaluation and analyzes potential cancellations during evaluation to guide coefficient pruning.
- Integrates with double-double and triple-double arithmetic to bound evaluation error and ensure correctness.
- Validates results through error bounds and empirical testing on functions like inverse error function and elementary functions.
Experimental results
Research questions
- RQ1Can coefficient pruning in polynomial approximations reduce both computational cost and numerical cancellation in floating-point evaluation?
- RQ2How can a minimax polynomial be optimized for floating-point implementation when some coefficients are numerically insignificant?
- RQ3To what extent can symmetry-based coefficient elimination be generalized beyond odd/even functions?
- RQ4Can a purely numerical algorithm, without symbolic analysis, effectively identify and eliminate small coefficients in polynomial approximations?
- RQ5How does the proposed method compare in accuracy and efficiency to standard minimax or Taylor-based approximations?
Key findings
- The algorithm successfully identifies and eliminates small coefficients in polynomial approximations, reducing the number of terms and improving numerical stability.
- For the inverse error function on [-1/4, 1/4] with a relative error bound of 2^-60, the method produced a 19th-degree odd polynomial with only odd-degree terms, achieving an approximation error of 2^-62.9.
- The evaluation error of the resulting polynomial, when computed using double-double arithmetic, was bounded by 2^-62.4, demonstrating high accuracy.
- The method automatically selects an appropriate monomial basis (e.g., odd powers for odd functions) even when the function is treated as a black box, without prior knowledge of symmetry.
- The approach reduces operation count and avoids cancellation by ensuring that coefficient magnitudes do not differ excessively, improving performance and reliability in floating-point arithmetic.
- The algorithm has been successfully integrated into tools like Sollya and used to implement functions in the CRLibm library, demonstrating practical utility.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.