Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!l35g2000vba.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: adding order matters for accuracy ?
Date: Thu, 17 Sep 2009 00:32:12 -0700 (PDT)
Organization: http://groups.google.com
Lines: 32
Message-ID: <30d4f11f-0dce-40ba-bef9-b7afe7355146@l35g2000vba.googlegroups.com>
References: <h8mqh5$pgb$1@fred.mathworks.com>
NNTP-Posting-Host: 77.16.180.65
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1253172732 15427 127.0.0.1 (17 Sep 2009 07:32:12 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 17 Sep 2009 07:32:12 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: l35g2000vba.googlegroups.com; posting-host=77.16.180.65; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 
	.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:570999

On 15 Sep, 03:27, "Ana-Maria Cuculescu" <amcucule...@yahoo.com> wrote:
> Does the order in which we add numbers affect the accuracy of the result in Matlab?
>
> For example, if I add
>
> 1/1 + 1/2 + ... + 1/100000 in this order
>
> and, then, if I add
>
> 1/100000 + 1/2 + ... + 1/1 in this order
>
> will the adding order generate errors from the point of view of accuracy?

Well, it is not the order the numbers are added
that generates the error. As you know from working
with pen and paper, the order the numbers are added
does not influence the result, assuming the numbers
are exact. The error is in the numbers themselves
because they are represented inside computer on
inexact floating point formats.

The order the numbers are added influence how
the already present error is magnified throughout
the computation.

Knowing how to handle such issues is an art,
and is among the details that separate brilliant
numeric programmers from mere good ones. You will
find these kinds of questions discussed in texts
on numerical methods.

Rune