<< accsum_compsum Accsum accsum_dcs >>

Accsum >> Accsum > accsum_dblcompsum

accsum_dblcompsum

The doubly compensated sum of a matrix.

Calling Sequence

s = accsum_dblcompsum ( x )
[s,e] = accsum_dblcompsum ( 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 the sum of x. Algorithm 4.2 in SNAA (Doubly Compensated Summation) Due to Priest (and Kahan) Assumes that Scilab uses round-to-nearest.

Examples

[s,e] = accsum_dblcompsum ( [2 1] ) // 3
[s,e] = accsum_dblcompsum ( [1 2] ) // 3
// is 1+(%eps/2) but is 1 without algo
[s,e] = accsum_dblcompsum ( [1 %eps/2 ] )
// is 1+(%eps/2) but is 1 without algo
[s,e] = accsum_dblcompsum ( [%eps/2 1] )

Authors

Bibliography

"Stability and numerical accuracy of algorithms", Nicolas Higham

"Handbook of Floating Point Computations", Muller et al

<< accsum_compsum Accsum accsum_dcs >>