Post Reply 
Newton and Halley's methods with enhanced derivatives estimation
10-06-2017, 09:50 PM (This post was last modified: 10-06-2017 09:53 PM by Dieter.)
Post: #8
RE: Newton and Halley's methods with enhanced derivatives estimation
(10-06-2017 08:40 PM)Gerson W. Barbosa Wrote:  T = 1E-8

In the original program T is the allowed absolute error, so my suggestion to set T=1E–8 was, er... "not yet perfect". #-)
It's the relative error that should be compared to this value. So the respective code line should better read

130 IF ABS(D)>=ABS(T*X) THEN 50

Looking at the results you posted...

(10-06-2017 08:40 PM)Gerson W. Barbosa Wrote:  Initial guess: 0.1

0.0659646010039

After one additional iteration:

0.0659646009050

Exact 12-digit result:

0.0659646009778

...the iteration seems to converge slower than expected so that 1E–8 looks like a bit too much. On the other hand it may be just right here: I entered your FNX(X) formula into my 35s (same 12 digit precision), and indeed the function result rounds to zero even if x varies in the last 3 or 4 (!) digits. So anything around 0,065964601 is considered a solution, e.g. both 0,06596460094 and 0,06596460103 return f(x)=0. That's one of the reasons why T should not be chosen too small: even if the last two approximations agree in merely 8 significant digits, additional iterations may not yield a more accurate result since the last digits of x may vary without changing the function result.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Newton and Halley's methods with enhanced derivatives estimation - Dieter - 10-06-2017 09:50 PM



User(s) browsing this thread: 1 Guest(s)