A shared number model clarifies when rounding can be reused
When Double Rounding is Correct · arXiv:2610.09005

In plain words
The paper develops a shared way to describe many number formats, including fixed-point and floating-point. The authors use it to check when rounding in two steps gives the same answer as rounding directly, and to rewrite calculations so they can run with available arithmetic operations.
They show that some rounding-mode pairings are safe under stated conditions, while others can fail even with a very wide intermediate format. In one sampled dot-product setup, a plain FP32 version disagreed with the specification on about 5.2% of inputs.
The research
When software simulates specialized arithmetic, can it use a wider calculation and round afterward without changing the specified answer? Existing libraries support limited formats, and the correctness of rounding twice depends on the formats and rounding modes involved. The paper develops a way to determine when that shortcut is justified.
The authors unify number formats and derive checks that show when intermediate rounding can preserve a direct result.
They model formats using precision, a minimum representable step when one exists, and maximum value, then check containment from those parameters.
Their rules identify conditions for six rounding-mode pairings; counterexamples show that simply widening the intermediate format cannot make the other ten pairings generally safe.
In one MX dot-product setup, a plain FP32 implementation disagreed with the specification on about 5.2% of one million sampled block pairs. This shows why a simulation may need to preserve the specified rounding steps.
The guarantees cover the paper’s abstract formats and extend to double rounding, including overflow and special values, when the paper's composition conditions hold.
The practical results cover the specific operations, formats, inputs, and implementations tested; signed zero and dynamically bounded loops are outside the stated analysis.
What the evidence shows
- A shared format model
The paper introduces an abstract number format, a theoretical model that represents fixed-point and floating-point formats with shared parameters. This addresses a practical problem: software libraries often support only limited formats, while hardware designs may use specialized formats that general-purpose processors cannot directly model.
The authors use the model to ask when arithmetic can be simulated faithfully and when intermediate rounding changes the result.
- Checking representable values
The model lets the authors check format containment: whether every value in one format is representable in another. Their complete check uses format parameters instead of listing values.
They then use format inference to bound the values produced by program expressions. Those bounds support decisions about when a rounding step can be removed or replaced without changing the result.
- Where two roundings work
The authors derive sufficient conditions for correct double rounding, where a value is rounded first to an intermediate format and then to a target. Six of the sixteen analyzed rounding-mode pairings have such conditions.
Round-to-odd can serve as the intermediate mode for all four final modes with at most two extra bits of precision, subject to the required containment and bound conditions.
- Why wider can still fail
The remaining ten mode pairings have counterexamples: format containment by itself does not guarantee that two rounds match one direct round, even when the intermediate format is arbitrarily wide. Separately, in one MX dot-product setup, a plain FP32 implementation disagreed with the specified algorithm on about 5.2% of one million sampled block pairs. The theory identifies conditions; the sample illustrates a practical mismatch.
- From rules to implementations
The authors implement MPFX, a correctly rounded number library, and compare it with SoftFloat on shared operations and formats. Across the measured operations, FP16 and FP32, and three rounding modes, the faster MPFX implementation ranged from 0.44 to 1.62 times SoftFloat’s speed.
In three MX dot-product element-format configurations, MPFX ran 9.99, 13.26, and 1.40 times as fast as the corresponding SoftFloat implementation on sampled block-quantized inputs.
Deep
- Original paper authors
- Brett Saiki, Bill Zorn, Cynthia Richey, Zachary Tatlock
- Submitted to arXiv
- License
- CC BY 4.0