Sterbenz exact subtraction #
Sterbenz's lemma applies to the rounded-real grid of every fmt: two same-sign representable
values within a factor of two have an exactly representable difference. For an IEEE descriptor,
subtraction of the corresponding finite model values is finite and decodes to that exact real
difference. The same-sign forms cover negative operands and zero as well.
References #
- R. P. Brent and P. Zimmermann, Modern Computer Arithmetic, Theorem 3.4. https://members.loria.fr/PZimmermann/mca/mca-cup-0.5.9.pdf
- Flocq,
Flocq.Prop.Sterbenz. https://flocq.gitlabpages.inria.fr/flocq/html/Flocq.Prop.Sterbenz.html
Sterbenz exactness for the rounded-real grid selected by fmt: two positive representable reals
within a factor of two have a representable difference, so nearest-even rounding changes nothing.
The nonnegative and same-sign variants below also cover zero and negative operands.
Subtraction of positive finite executable values within a factor of two has no rounding error.
The Sterbenz hypotheses also bound the exact difference by one of the finite operands, so the theorem derives finiteness of the executable result instead of assuming it.
Sterbenz exactness for nonnegative representable reals, including the zero case.
Sterbenz exactness for representable reals of the same sign within a factor of two.
Same-sign finite subtraction cannot overflow, independently of the factor-of-two condition.
Subtraction of finite values of the same sign within a factor of two has the exact real difference. The real-valued statement includes both signs of zero.