Re: adding order matters for accuracy ?



"Matt " <xys@xxxxxxxxxxxx> wrote in message <h8u0tn$g7e$1@xxxxxxxxxxxxxxxxxx>...
"Bruno Luong" <b.luong@xxxxxxxxxxxxxxxxxxxx> wrote in message <h8tuq7$qpr$1@xxxxxxxxxxxxxxxxxx>...

There's something I still don't understand here. According to my numerical analysis books, the relative error does not accumulate when you add up numbers of the same sign.

Not sure where this wrong statement you read from.

From "Introduction to Numerical Analysis" by Stoer and Bulirsch, but the idea is very simple. If the true values being summed are x(i) and have a relative error of u(i), then the computed sum S is given by,

S=sum( x.*(1+u) )

Since the true value of the sum is

S_true=sum(x)

this produces a relative error in S is

RelativeError= ( S- sum(x) )/sum(x)

= sum u.* x/sum(x)

But since all the x have the same sign the coefficients x(i)/sum(x) are a partition of unity, leading to

abs(RelativeError)<=max(abs(u))

The above is about finite precision error due to truncation (and their propagation), not error due when making the sum between two numbers that have widely different magnitudes.

The later can accumulate as various examples have showed.

Bruno
.



Relevant Pages

  • Re: Truncation of infinite series
    ... > If I knew the exact sum of the series, I wouldn't need to approximate it by ... > What is needed is a general method for estimating relative error based on the ...
    (sci.math)
  • Re: Truncation of infinite series
    ... >> As Virgil wrote, the relative error is the absolute divided by the ... > If I knew the exact sum of the series, I wouldn't need to approximate it ... therefore I gave the upper bound. ... I said E/Sis an upper bound for the relative error; ...
    (sci.math)
  • Re: Truncation of infinite series
    ... Karl and Virgil wrote: ... also if Sdenotes the value of the infinite sum: ... > Since the sum of the series is strictly increasing, ... What is needed is a general method for estimating relative error based on the partial sum ...
    (sci.math)
  • Re: Truncation of infinite series
    ... the relative error is the absolute divided by the ... Since the sum of the series is strictly increasing, an upper bound is ...
    (sci.math)