<< accsum_getpath Support accsum_order >>

Accsum >> Accsum > Support > accsum_higham

accsum_higham

Returns an example designed by Higham.

Calling Sequence

x = accsum_higham ( )

Parameters

x :

a 4-by-1 matrix of doubles

Description

This example is so that the orderings produce different results.

The exact sum is 1.

Increasing magnitude and Psum (dynamic ordering, with order=1) produce 0, while decreasing magnitude produce 1.

Examples

x = accsum_higham ( )
sum(x)
// With direct input x: expected = 0
s = accsum_straight(x)
// With increasing magnitude ordering: expected = 0
s = accsum_straight(accsum_order ( x , 4 ))
// With dynamic magnitude ordering: expected = 0
s = accsum_orderdynamic ( x , 1 )
// With decreasing magnitude ordering: expected = 1
s = accsum_straight(accsum_order ( x , 5 ))

Authors

Bibliography

"Stability and numerical accuracy of algorithms", Nicolas Higham

"Handbook of Floating Point Computations", Muller et al

https://hpcrd.lbl.gov/SCG/ocean/NRS/ECMWF/img16.htm


<< accsum_getpath Support accsum_order >>