Re:John Gustafson’s crusade to replace floating point with s...
by FabHK on Tuesday July 09, 2019 @10:36AM
(#20392155)
Summation of an array is surprisingly non-trivial. Below a discussion about it with many interesting links (including Kahan summation and pairwise summation) if you want to go down some unexpected rabbit holes.
Somewhere I've seen a little routine (by Stefan Karpinski of Julia fame) that starts with a fixed pre-determined array of numbers, and you give it a desired target number, and it permutes the numbers of the array such that when you sum them up (naively, from left to right) the result is your desired target number [2].
Somewhere I've seen a little routine (by Stefan Karpinski of Julia fame) that starts with a fixed pre-determined array of numbers, and you give it a desired target number, and it permutes the numbers of the array such that when you sum them up (naively, from left to right) the result is your desired target number [2].
https://discourse.julialang.org/t/accurate-summation-algorit...
EDIT: [2] https://discourse.julialang.org/t/array-ordering-and-naive-s...