Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Subtracting sets of nearly equal fp numbers
Date: Fri, 16 Dec 2011 15:22:08 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 12
Message-ID: <jcfnn0$d3e$1@newscl01ah.mathworks.com>
References: <jcfgck$geh$1@newscl01ah.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1324048928 13422 172.30.248.37 (16 Dec 2011 15:22:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Dec 2011 15:22:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:752542

"Richard " <rfrank@dominionsw.com> wrote in message <jcfgck$geh$1@newscl01ah.mathworks.com>...
> If I have two sets of data that are very similar , and want to find the difference, is there a best practice for avoiding loss of significance.? I.e. add a constant to one set prior to subtraction and the subtracting the offset?
> 

No. There is no magic trick to prevent a loss of significance
here. In fact, adding some constant to each number will only
increase the error at the end.

The "best practice" is just to subtract the numbers, and live
with the loss of precision!

John