Numerical Algorithms

, Volume 37, Issue 1, pp 101-112

First online:

Fast and Accurate Floating Point Summation with Application to Computational Geometry

  • James DemmelAffiliated withComputer Science Division and Mathematics Department, University of California
  • , Yozo HidaAffiliated withComputer Science Division, University of California

Rent the article at a discount

Rent now

* Final gross prices may vary according to local VAT.

Get Access


We present several simple algorithms for accurately computing the sum of n floating point numbers using a wider accumulator. Let f and F be the number of significant bits in the summands and the accumulator, respectively. Then assuming gradual underflow, no overflow, and round-to-nearest arithmetic, up to ⌊2 Ff /(1−2f )⌋+1 numbers can be accurately added by just summing the terms in decreasing order of exponents, yielding a sum correct to within about 1.5 units in the last place. In particular, if the sum is zero, it is computed exactly. We apply this result to the floating point formats in the IEEE floating point standard, and investigate its performance. Our results show that in the absence of massive cancellation (the most common case) the cost of guaranteed accuracy is about 30–40% more than the straightforward summation. If massive cancellation does occur, the cost of computing the accurate sum is about a factor of ten. Finally, we apply our algorithm in computing a robust geometric predicate (used in computational geometry), where our accurate summation algorithm improves the existing algorithm by a factor of two on a nearly coplanar set of points.

floating point summation rounding error analysis computational geometry robust geometric predicate