Overview Accsum accsum_dblcompsum

Accsum >> Accsum > accsum_compsum

accsum_compsum

The compensated sum of a matrix.

Calling Sequence

s = accsum_compsum ( x )
[s,e] = accsum_compsum ( x )

Parameters

x :

a n-by-m matrix of doubles

s :

a 1-by-1 matrix of doubles, the highest significant digits of the sum

e :

a 1-by-1, matrix of doubles, the lowest significant digits of the sum

Description

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.

Examples

[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] )

Authors

Bibliography

"Stability and numerical accuracy of algorithms", Nicolas Higham

"Handbook of Floating Point Computations", Muller et al

Overview Accsum accsum_dblcompsum