Los Alamos National Laboratory, United States of America
Due to accumulated round-off error, mathematically equivalent floating-point summations can yield different computational results. Errors propagated across time steps can be substantial and can lead to significant inaccuracy in the final results. We focus on sums in an adaptive mesh refinement hydrocode. We reduce error in a moderate-length equation by generating proper ordering and grouping of the terms and verify this on a typical numerical simulation. Our techniques show equivalent accuracy to classic methodology like Kahan without the extra overhead. The heuristics presented here could improve accuracy in single and double precision for many codes. With some knowledge and minimal effort, researchers can apply these techniques and see improvement in the accuracy of code at no cost in performance. The same approach may facilitate reduced precision computation.