TL;DR
This paper introduces the first comprehensive benchmark for interval computation libraries, addressing the lack of standardized testing and the critical need for reliable interval arithmetic in scientific computing. By comparing popular C/C++ libraries across various platforms, they reveal significant differences in correctness, speed, and consistency, highlighting filib as the current best all-around option.
What Problem Does This Paper Address?
Floating-point arithmetic, the backbone of most scientific computations, is inherently imprecise due to rounding errors. Interval arithmetic offers a powerful solution by representing numbers as ranges (intervals) that are guaranteed to contain the true result, thus providing certifiable correctness. This is crucial for applications demanding high reliability, such as computer-aided design, geometric computing, and precision manufacturing. However, despite its importance, interval arithmetic support is not standardized, and existing libraries often exhibit inconsistencies and bugs, especially across different hardware architectures, operating systems, and compiler versions. This makes it difficult for developers to choose a reliable library and for library developers to ensure the quality of their implementations.
Methods
The authors developed a benchmark designed to rigorously test interval computation libraries across four key dimensions: correctness, interval size, speed, and consistency/portability.
- Correctness: They generated a suite of 28 basic expressions and used 104 expressions from the FPBench benchmark. For each expression, they generated one million random inputs and computed the exact solution using arbitrary-precision arithmetic (Mathematica) to serve as a ground truth.
- Interval Size: This metric evaluates how "tight" the computed intervals are. They used a rational subtraction method to quantify the size of the resulting intervals.
- Speed: Performance was measured by executing each expression 1,000 times for each of 10,000 inputs and accumulating the total execution time.
- Consistency and Portability: The benchmark was deployed on four distinct platforms (Windows, macOS on Intel and ARM, and Linux) with different compilers to assess how consistently libraries perform and if their results vary across environments.
The benchmark specifically targets limitations in how libraries handle basic arithmetic, transcendental functions, and composite expressions, as well as the impact of hardware rounding mode control and software-based interval computation strategies.
Datasets
The paper introduces a new benchmark suite for interval computation libraries. This benchmark includes:
- 28 custom-designed basic expressions covering arithmetic operations, transcendental functions, and combinations thereof.
- 104 expressions adapted from the FPBench benchmark, which is a well-known suite for evaluating floating-point accuracy across various application domains.
The benchmark also utilizes a large number of randomly generated inputs (one million per expression) to ensure thorough testing.
Key Insights and Ideas
- No Silver Bullet: The study reveals that no single library excels in all aspects. Libraries that rely on hardware rounding mode control (like Boost and
filib++'snative_switchedmode) can be faster but are more prone to correctness issues and inconsistencies across platforms. - The Danger of Hardware Rounding: While hardware rounding modes can speed up computations, they introduce subtle correctness problems, especially with transcendental functions and composite expressions. Boost, for instance, fails on several transcendental functions due to this reliance.
- Software Implementations Shine: Pure software implementations, like
filibandfilib++'spred_succandmultiplicativemodes, demonstrate superior correctness across the board, even though they might incur a performance penalty. filibis the Current Champion: For a balance of correctness, consistency, portability, and reasonable speed,filibemerges as the most robust and reliable option among those tested.filib++'s Modes Matter:filib++offers different modes, and their performance and correctness vary significantly. Thepred_succandmultiplicativemodes are generally more correct thannative_switched.
Key Results
- Correctness: Only
filibandfilib++'spred_succandmultiplicativemodes passed all correctness tests. Boost failed on transcendental functions, andfilib++'snative_switchedmode had issues with some FPBench expressions. BIAS produced incorrect intervals for certain composite expressions. - Interval Size: Libraries using hardware rounding modes generally produced smaller intervals for purely arithmetic expressions, but the differences were minor. For expressions with transcendental functions, interval sizes became less predictable.
- Speed: Boost was consistently the slowest. BIAS was also slower than
filib. Amongfilib++'s modes,multiplicativewas the fastest, followed bypred_succ, withnative_switchedbeing the slowest, especially for complex expressions. - Consistency:
filibandfilib++'spred_succandmultiplicativemodes showed consistent results across platforms. Boost andfilib++'snative_switchedmode exhibited platform-dependent variations in interval size and false positive rates. - False Positives: While no library produced false negatives (missing a collision), the number of false positives varied, with Boost and
filib++'snative_switchedshowing architectural differences.
Limitations and Future Work
- Benchmark Completeness: The authors acknowledge that their benchmark, while extensive, cannot exhaustively test all possible combinations of operations and operands. A library passing their tests might still contain errors.
- Library Maintenance: BIAS is noted as not being actively maintained, and
filib++has not been updated since 2011, limiting its compatibility with modern systems. - Future Work: The authors provide their benchmark code and scripts on GitHub, encouraging its use for testing existing libraries and guiding the development of future interval libraries. They also suggest that the benchmark can be extended to include more complex real-world applications.
Summary updated