4.6 Summation Summary

   

 
Java Number Cruncher: The Java Programmer's Guide to Numerical Computing
By Ronald  Mak

Table of Contents
Chapter  4.   Summing Lists of Numbers

4.6 Summation Summary

We can sum up, so to speak, the lessons of this chapter:

  • When summing lists of numbers with the same sign, add them in the sorted order of the smallest magnitude to the largest.

  • Avoid magnitude errors that occur whenever the differences between the binary exponents of the addends exceed 24 for float and 53 for double. The Kahan Summation Algorithm works well despite magnitude errors.

  • When summing lists of numbers with mixed signs, avoid cancellation errors by subtotaling the positive and negative numbers separately.

  • Double-precision arithmetic is not a cure-all.

  • Sometimes we may have to try several summation algorithms before we find one that works.

  • The best strategy of all is to gain some insight into the nature of the problem.


   
Top
 


Java Number Cruncher. The Java Programmer's Guide to Numerical Computing
Java Number Cruncher: The Java Programmers Guide to Numerical Computing
ISBN: 0130460419
EAN: 2147483647
Year: 2001
Pages: 141
Authors: Ronald Mak

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net