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

compensated-summation

Compensated summation algorithms for better precision

1 unstable release

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

#751 in Algorithms

Download history 224/week @ 2024-05-12 166/week @ 2024-05-19

390 downloads per month

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

~155KB