Kahan summation algorithm 2026-10-20
A summation algorithm that keeps a correction for low-order information lost when adding floating-point numbers. Feeding that correction into subsequent additions can greatly reduce accumulated rounding error compared with straightforward summation.