Returns an example designed by Higham.
x = accsum_higham ( )
a 4-by-1 matrix of doubles
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.
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 ))
"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