Skip to main content
8 votes

Ensuring IEEE 754 Compliance and Numerical Precision in C++ HPC Projects

IEEE 754 conforming floating point arithmetic has rounding errors. The rounding errors are well defined and reproducible, so two calculations will give you the exact same results - with the same ...
gnasher729's user avatar
8 votes

Unexpected result when summing sorted (and unsorted) positive floating point numbers

Very interesting problem! I might have a partial answer. To start, I replicated a simple C++ demo that can reproduce the effect ...
Mikael Öhman's user avatar
7 votes

Ensuring IEEE 754 Compliance and Numerical Precision in C++ HPC Projects

My suggestion is to just not worry about it. We run the ~13,000 tests of the deal.II project in both debug and release mode (the latter involving high optimization flags) and do not observe ...
Wolfgang Bangerth's user avatar
3 votes

Ensuring IEEE 754 Compliance and Numerical Precision in C++ HPC Projects

In complementation of others answers that say to write runnable tests with tolerances, I further add to not write static tests at all. Optimizing compilers are in the business of generating results, ...
André L F S Bacci's user avatar
2 votes

Ensuring IEEE 754 Compliance and Numerical Precision in C++ HPC Projects

I agree with the answer of @Wolfgang Bangerth. If you insist on testing the effects yourself you could set up explicit assertions or even unit tests for the 5 rounding types and the recommended ...
MPIchael's user avatar
  • 2,935

Only top scored, non community-wiki answers of a minimum length are eligible