Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: taylor polynomial evaluation
Date: Sat, 15 Nov 2008 21:59:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gfngn7$acs$1@fred.mathworks.com>
References: <gfl7ue$un$1@fred.mathworks.com> <gfle3a$30v$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226786343 10652 172.30.248.37 (15 Nov 2008 21:59:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 15 Nov 2008 21:59:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1581815
Xref: news.mathworks.com comp.soft-sys.matlab:501021


Thank you for your reply, 
i got it working OK now. The error is of 10^-16 order.


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gfle3a$30v$1@fred.mathworks.com>...
> "rose lans" <byrusel42@yahoo.com> wrote in message <gfl7ue$un$1@fred.mathworks.com>...
> > Hi, I am trying to evaluate log(x) by using  taylor polynomial with degree that will 
> > ..... SNIP .....
> > Rose
> 
>   In the range from x = 1 to x = 1.5 the terms in your series reverse sign at each term and each one is smaller in magnitude than the previous one.  Therefore the next unused term gives you an upper bound for the total error incurred.  For x = 1.5 the 10-th term would be about 1/10^4, representing overall accuracy better than the fourth decimal place.
> 
>   On the other hand x = 0.5 yields a series of terms all of the same negative sign.  This means the error made is the sum of a number of negative quantities beyond the end of the polynomial which combine their magnitudes, and that would explain the larger error that you are apparently experiencing.
> 
>   You will find that the Taylor expansion does not in general provide the best approximating polynomials for analytic functions for given intervals.  There exist much better polynomials than that, but it requires some optimization work to find them.  Short of that, you will have to use far more than nine polynomial terms to get good accuracy as far out from x = 1 as x = 0.5.
> 
> Roger Stafford