https://github.com/r-barnes/reproducible_floating_sums
Reproducible floating-point summations
https://github.com/r-barnes/reproducible_floating_sums
floating-point
Last synced: 3 months ago
JSON representation
Reproducible floating-point summations
- Host: GitHub
- URL: https://github.com/r-barnes/reproducible_floating_sums
- Owner: r-barnes
- License: mit
- Created: 2021-05-25T18:53:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-13T21:22:04.000Z (almost 4 years ago)
- Last Synced: 2025-04-15T05:17:31.842Z (about 1 year ago)
- Topics: floating-point
- Language: C++
- Homepage:
- Size: 46.9 KB
- Stars: 7
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Reproducible Floating-Point Summations
======================================
Floating-point sums are non-associative. That is,
```
(a+b)+c != a+(b+c)
```
This is problematic for performing reductions in which the ordering of the reduction or the partitioning of the data is non-deterministic, such as with internode communication or atomics.
This repo provides implementations of two papers which pre-round floating-point numbers to achieve reproducible results with (often) small reductions in accuracy versus a perfectly accurate summation (simulated in the test suite using Kahan summation). Both implementations' accuracy is likely to be greater than a simple summation.
The papers implemented are
* Demmel and Nguyen (2013). "Fast Reproducible Floating-Point Summation".
* Ahrens, Demmel, and Nguyen (2020). "Algorithms for Efficient Reproducible Floating Point Summation"
Building
---------------------------------------
```bash
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make
```