Floating-Point Spacing and Rounding

Calculate how representable spacing grows with magnitude and interpret a rounded operation under its normal-range assumptions.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. The significand has a fixed bit budget
  2. Use a relative error model within its stated range

The significand has a fixed bit budget

For binary floating point with \(p\) significand bits, consecutive numbers in the binade \([2^e,2^{e+1})\) are spaced \(2^{e-p+1}\) apart. At \(e=p\) that spacing is two. Adding one to \(2^p\) therefore produces an exact sum halfway between two representable values. Round-to-nearest with ties to even returns \(2^p\). A positive increment can vanish because its size is below the precision available at the larger magnitude.

Use a relative error model within its stated range

For round-to-nearest without overflow or problems near underflow, a rounded result can be modeled as \(z(1+\delta)\) with \(|\delta|\le 2^{-p}\), when \(z\) is the exact result. Subnormal spacing, special values and directed rounding need their own handling. The model bounds one operation. Accumulation across operations needs an algorithmic argument. Compensated summation addresses lost low-order additions. Forward and backward error place a computed result in relation to exact mathematics.[1][2]

References

  1. Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms ↩
  2. Jonathan Richard Shewchuk, Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates ↩