The compensated sum of a matrix.
s = accsum_compsum ( x ) [s,e] = accsum_compsum ( x )
a n-by-m matrix of doubles
a 1-by-1 matrix of doubles, the highest significant digits of the sum
a 1-by-1, matrix of doubles, the lowest significant digits of the sum
Returns s and e such that s+e is the sum of x. Algorithm 4.4 in HFCC Due to Knuth No assumption on a , b Assumes that Scilab uses round-to-nearest.
[s,e] = accsum_compsum ( [2 1] ) // 3 [s,e] = accsum_compsum ( [1 2] ) // 3 // is 1+(%eps/2) but is 1 without algo [s,e] = accsum_compsum ( [1 %eps/2 ] ) // is 1+(%eps/2) but is 1 without algo [s,e] = accsum_compsum ( [%eps/2 1] )
"Stability and numerical accuracy of algorithms", Nicolas Higham
"Handbook of Floating Point Computations", Muller et al