Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: rounding issue
Date: Sat, 21 Mar 2009 07:58:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gq26m9$39$1@fred.mathworks.com>
References: <gq04jp$8ee$1@fred.mathworks.com> <gq1pi9$87i$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237622282 105 172.30.248.38 (21 Mar 2009 07:58:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 21 Mar 2009 07:58:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:526576


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gq1pi9$87i$1@fred.mathworks.com>...
> ......
>   Offhand I would say that the very nature of the series you are using is doomed to fail in such circumstances, and there is a need for a different mathematical method for computing your desired "voltage raise" or whatever it is you are calculating.
> ......

  I should have pointed out that your series is quite analogous to calculating exp(-x) using the Taylor expansion where -x is a large negative number such as -20:

 exp(-x) = 1/0! - x/1! + x^2/2! - x^3/3! + x^4/4! - x^5/5! + ...

The correct sum of the series is exp(-20) = 2.06e-9 but the individual terms in the series reach a maximum of (-20)^20/20! = 4.31e+7.  The round-off error in computing that one term alone can be larger than the correct answer, so there is no hope of calculating a decent exp(-20) in this manner.

Roger Stafford