In safety-critical embedded systems—such as flight controllers or medical devices—the discrepancy between real-valued mathematical models and their floating-point implementations can have catastrophic consequences. While linear error analysis is well-understood, computing rigorous upper bounds for roundoff errors in non-linear programs remains a significant challenge. This paper by Magron, Rocca, and Dang introduces two novel algorithms, FPBern and FPKriSten, designed to provide certified error bounds for polynomial and rational functions.
The Problem: Non-Linear Floating-Point Complexity
Theoretical models are typically designed using real algebra, but physical implementations rely on floating-point arithmetic. Every operation introduces a finite precision error. For non-linear programs—those involving polynomials or rational functions—finding a tight, guaranteed upper bound on the total accumulated error is an NP-hard problem. Existing validation tools often suffer from a trade-off: they either produce "loose" bounds that overestimate the error or require prohibitive computational resources for complex functions.
Methodology: Bernstein and Krivine-Stengle
The authors propose two distinct approaches adapted from global optimization techniques to bridge the gap between accuracy and efficiency.
1. Bernstein Expansions (FPBern)
The FPBern method utilizes the Bernstein basis rather than the standard monomial basis to represent polynomials. This approach leverages the Enclosure Property, which guarantees that the minimum and maximum values of a polynomial over a given box are contained within the range of its Bernstein coefficients. A key contribution of this work is the extension of this method to handle rational functions (fractions of polynomials), significantly expanding its applicability to real-world code.
2. Sparse Krivine-Stengle Representations (FPKriSten)
FPKriSten is designed for polynomials defined over semialgebraic sets (regions defined by polynomial inequalities). It employs Linear Programming (LP) relaxations to find certificates of positivity. To maintain computational feasibility, the authors implement a sparse version of the Krivine-Stengle representation. By exploiting the fact that most terms in a program involve only a small subset of variables, the sparse approach drastically reduces the complexity of the resulting LP problem.
Experimental Evaluation
The researchers evaluated their tools against a suite of 35 programs, including 27 established benchmarks from biology, aerospace, and global optimization (e.g., kepler, rigidBody, doppler), and 8 new benchmarks designed to test scalability across variable counts and polynomial degrees.
Key Insights
- Sparsity and Scalability: The transition from dense to sparse representations allows
FPKriStento handle problems that were previously computationally "un-runnable." - Convergence and Certification: The authors proved a linear convergence rate for both methods relative to "degree elevation." Furthermore, the bounds are "certified" because Bernstein coefficients can be computed using rational arithmetic, preventing the analysis itself from introducing new floating-point errors.
Results
The experimental results demonstrate that FPBern and FPKriSten achieve state-of-the-art performance:
- Accuracy: On the
kepler1benchmark, the proposed methods were 6% more accurate thanReal2FloatandFPTaylor, and 53% more accurate thanRosa. - Speed: The double-precision version,
FPBern(a), was consistently the fastest tool across nearly all benchmarks. - Robustness:
FPKriStenoutperformed Bernstein-based methods as the number of input variables increased, provided the polynomial degree remained low. For instance, on theex-10-2-2benchmark,FPKriStencompleted the analysis in approximately 5.5 seconds, whereas the rational version ofFPBernfaced significant performance hurdles.
Limitations and Future Work
While providing a significant advancement, the tools currently have distinct specializations: FPBern handles rational functions within box constraints, while FPKriSten manages complex semialgebraic constraints for polynomials. Additionally, the current implementations do not yet support control flow structures like loops or conditional statements. Future research aims to integrate these tools with formal proof assistants such as Coq or PVS to provide end-to-end formal verification of the computed error bounds.
Summary updated