Numerical Algorithms

, Volume 37, Issue 1–4, pp 101–112

Fast and Accurate Floating Point Summation with Application to Computational Geometry

  • James Demmel
  • Yozo Hida

DOI: 10.1023/B:NUMA.0000049458.99541.38

Cite this article as:
Demmel, J. & Hida, Y. Numerical Algorithms (2004) 37: 101. doi:10.1023/B:NUMA.0000049458.99541.38


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 ⌊2Ff/(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 

Copyright information

© Kluwer Academic Publishers 2004

Authors and Affiliations

  • James Demmel
    • 1
  • Yozo Hida
    • 2
  1. 1.Computer Science Division and Mathematics DepartmentUniversity of CaliforniaBerkeleyUSA
  2. 2.Computer Science DivisionUniversity of CaliforniaBerkeleyUSA

Personalised recommendations