Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

How should we compute a sum S = a1 + a2 + + an

How should we compute a sum
S = a1 + a2 + + an
with a sequence of machine numbers {a1, ..., an}. Should
we add from largest to small, should we add from
smallest to largest, or should we just add the numbers
based on their original given order? In other words,
does it matter how we calculate the sum?
Recall the relationship between a number x and its
machine approximation fl(x):
fl(x) = (1 + ) x
For bounds on for a binary floating point represen-
tation with N binary digits in the mantissa, we have
-2-N 2-N, rounding
-2-N+1 0, chopping
We use these results as tools for analyzing the error
in computing the sum S.
We create the sum S by a sequence simple additions.
S2 = fl (a1 + a2) = (1 + 2) (a1 + a2)


Source: Atkinson, Kendall - Departments of Computer Science & Mathematics, University of Iowa


Collections: Computer Technologies and Information Sciences