This is the C++ implementation of xsum which is fast exact summation using small and large superaccumulators.
This code include test cases in TestRunner.cpp.
This code is based on this commit from Radford M. Neal's xsum repository.
- Make sure that
cmake
is installed - To initialize build directory, run
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -S./ -B./build
- No need to run after the first time
- In the root dir, run
cmake --build ./build --config Release --target all -j 12 --
- Then run
./build/xsum
- xsum wont return
-0
(negative zero), however, this handle-0
. See test cases in TestRunner.cpp.