Compilers for Sound FloatingPoint
Explanation
Floatingpoint data types are a natural choice for software developers when implementing numerical computations. They are widely used in computer science and engineering, including in cyberphysical systems that interact with the physical world. Unfortunately, floatingpoint numbers do not exactly represent real values and thus can suffer from roundoff errors. Further, their nonintuitive nature can make it hard to predict when and how these errors accumulate to the extent that they invalidate the final result. Thus, it is important to provide guarantees (i.e, sound floatingpoint arithmetic) and do so fast for any given input.
We introduce IGen, a sourcetosource compiler that translates a numerical program performing floatingpoint computations to an equivalent sound numerical program using interval arithmetic (IA) or affine arithmetic (AA). By sound we mean that the resulting intervals are guaranteed to contain the result of the original program if it were performed using real arithmetic.
Overview
The picture below provides an overview of IGen’s internal structure. The input is a C function, possibly using SIMD intrinsics, performing floatingpoint computations and a target precision for the interval endpoints or affine error symbols. This target precision can be either single or double precision (the default) or the higher doubledouble precision. The output is an equivalent C function performing the same computation soundly using IA or AA, optionally optimized with SIMD intrinsics.
IGen uses the Clang LibTooling library to construct the abstract syntax tree (AST) of the computation. The AST is then traversed and, for each node, an equivalent set of interval operations is generated, possibly in increased precision. The support of SIMD intrinsics in the input function is handled by a generator that automatically produces the interval implementation of (a large subset of) SIMD intrinsics from its XML specification.
Improving accuracy. When generating IA code, IGen uses Polly and a transformation technique to improve the accuracy of the common reduction pattern in linearalgebralike computations. In AA mode, we implemented a preprocessing step that analyses the DAG of the computation and identifies affine variables that are likely to improve accuracy.
Evaluation
We evaluated IGen on an Intel Xeon E2176M CPU (Coffee Lake microarchitecture) running at 2.7 GHz, under Ubuntu 18.04 with Linux kernel v4.15. Turbo Boost is disabled. All tests are compiled using gcc 7.5 with flags O3 march=host. To evaluate performance, we use RDTSC to measure the cycle count for each test, performing 30 repetitions with warm cache, and using the median as a result. The accuracy of an interval is determined as the number of mostsignificant bits shared by the mantissas of the endpoints assuming same exponent. (An affine result is first transformed to an interval to compute its accuracy.)
For each benchmark, IGen generates interval code with the following configurations:
 IGenss: scalar code generated from scalar input code.
 IGensv: vectorized code (SSE) from scalar input code.
 IGenvv: vectorized code (AVX) from vectorized code.
 IGensvdd: as IGensv but with doubledouble precision output.
Performance. The figures below show the performance (in interval operations per cycle) of IGen and other interval libraries for a set of benchmarks. The problem size is on the xaxis and the interval operations (iops) per cycle on the yaxis. Here, an interval multiplication and an addition count as one operation each.
Runtimeaccuracy tradeoff of the AA configuration.
We present now the results of IGen in AA mode for benchmarks that are known to perform poorly in IA. The pareto plots below show the runtimeaccuracy tradeoff of different configurations of IGen and others AA libraries. Configurations closer to the bottomright corner are pareto optimal (i.e. they present higher accuracy and lower slowdown). The configurations generated by IGen are the following:
 f64adspv: AA vector code generated from scalar input code. (Red circles)
 IGenf64: IA vectorized code from scalar input code. (White circle)
 IGendd: IA vectorized code with doubledouble precision output. (White rhomb)
As can be seen, f64adspv (IGen with AA) is able to preserve a considerable higher accuracy for these benchmarks compared to IGenf64 and IGendd (IGen with IA).
References

Joao Rivera, Franz Franchetti, Markus Püschel
An Interval Compiler for Sound FloatingPoint Computations
in Proc. Code Generation and Optimization (CGO), pp. 5264, 2021 
Joao Rivera, Franz Franchetti, Markus Püschel
A Compiler for Sound FloatingPoint Computations using Affine Arithmetic
in Proc. Code Generation and Optimization (CGO), pp. 6678, 2022