# compensated-summation
> Compensated summation algorithms for better precision.
[](https://crates.io/crates/compensated-summation)
[](https://docs.rs/compensated-summation)
[](https://github.com/FedericoStra/compensated-summation)
[](https://github.com/FedericoStra/compensated-summation/actions/workflows/rust.yml)
[](https://deps.rs/repo/github/FedericoStra/compensated-summation)
[](https://choosealicense.com/licenses/mit/)
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](https://en.wikipedia.org/wiki/Kahan_summation_algorithm#The_algorithm) and [Kahan-Babuška-Neumaier](https://en.wikipedia.org/wiki/Kahan_summation_algorithm#Further_enhancements) algorithms for compensated summation.
Please see the [documentation](https://docs.rs/compensated-summation) for a description of the API and some usage examples.