Computer Arithmetic
What is the purpose of Kahan (compensated) summation when adding many floating-point numbers?
- ATo halve the number of additions and speed up the computation
- BTo convert all the floating-point numbers to integers before adding them
- CTo record lost parts and add them back, limiting error
Show answer and explanation
Answer: C. To record lost parts and add them back, limiting error
Each time a small value is added to a growing sum, its low-order digits are lost to absorption, and these losses accumulate into a large error. Kahan summation computes, after each addition, the difference between the actual increase and the value intended, records the lost part in a compensation variable, and adds it to the next value before summing. It costs several times more work but greatly limits error accumulation. It neither reduces the number of additions nor converts to integers.
- A. The work actually increases.
- B. It is not a method that converts to integers.
- C. Correct. It records and restores lost parts, limiting error accumulation.