#summation #sum #precision #kahan #numerical-error

compensated-summation

Compensated summation algorithms for better precision

1 unstable release

0.3.0 May 20, 2024
0.2.0 May 14, 2024
0.1.0 May 14, 2024

#1135 in Algorithms

MIT license

24KB
396 lines

compensated-summation

Compensated summation algorithms for better precision.

crates.io docs.rs GitHub GitHub Workflow Status Dependencies status MIT license

This crate implements summation algorithms that significantly reduce the numerical error in the total obtained by adding a sequence of finite-precision floating-point numbers, compared to the obvious approach.

Currently it implements the 2Sum and Fast2Sum from https://en.wikipedia.org/wiki/2Sum for exact addition and the Kahan-Babuška and Kahan-Babuška-Neumaier algorithms for compensated summation.

Please see the documentation for a description of the API and some usage examples.

Dependencies

~150KB