Post Reply 
41C/CV root finders
05-28-2015, 06:33 PM
Post: #35
RE: 41C/CV root finders
(05-28-2015 01:54 PM)Ángel Martin Wrote:  With the new initial estimation there's a marginal improvement - two iteration less if compared against e-8, or just one less if using the e-9 criteria.

This sounds like there is something wrong with f(i) and/or f'(i). Could you post these two formulas here?

A Newton-style solver should converge roughly quadratically, and the version I use does so. Here are the iteration results for the sample case. "err_abs" is the applied correction (delta_i) in that iteration step, and "err_rel" is the quotient of this and the current approximation, i.e. delta_i : i.

Code:
Initial estimate: 0,08571428572

     err_abs =     err_rel =   new i =
it#  f(i)/f'(i)    err_abs:i   i - delta_i
-------------------------------------------
(1)  -6,23 E-02   -4,21 E-01   0,1480341636
(2)   3,67 E-03    2,54 E-02   0,1443681501
(3)   9,44 E-06    6,54 E-05   0,1443587134
(4)   2,49 E-10    1,72 E-09   0,1443587132
-------------------------------------------

This nicely shows the quadratic convergence: the error is order of 10–1, 10–2, 10–5 and finally 10–9,
Here the program quits since 1,72 E-9 is below the error limit of 5 E–8.

(05-28-2015 01:54 PM)Ángel Martin Wrote:  It occured to me the reason for the larger number of loops could be that I check for f(i)/f '(i) to meet that criteria, and not for f(i) alone.

Sure, this is what I do as well. f(i)/f'(i) is the correction term, the mentioned "delta i". My 10-digit program quits if delta_i : i drops below 5E–8. Due to the quadratic convergence one can expect the result to be exact to 12–14 digits, plus/minus a slight unavoidable error in the last digit(s) due to roundoff.

(05-28-2015 01:54 PM)Ángel Martin Wrote:  This is more demanding when f '(i)<1, as the quotient would be larger than the numerator and thus a bit counterproductive...

Are there really cases where f'(i) is less than 1? Usually f'(i) is of similar magnitude as the payments, i.e. around 100 or 1000. For the sample case I get values around 4000 or 5000. You seem to use a different definition of the TVM function and its derivative. Sounds interesting, so again I would like to ask for the formulas you use.

BTW, thank you for the MOD files. I will use them with V41 and see what's in there. ;-)

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


Messages In This Thread
41C/CV root finders - Dave Britten - 05-20-2015, 07:07 PM
RE: 41C/CV root finders - Thomas Klemm - 05-20-2015, 07:36 PM
RE: 41C/CV root finders - Dieter - 05-20-2015, 07:44 PM
RE: 41C/CV root finders - Dave Britten - 05-20-2015, 08:08 PM
RE: 41C/CV root finders - Massimo Gnerucci - 05-20-2015, 08:40 PM
RE: 41C/CV root finders - Dave Britten - 05-20-2015, 08:49 PM
RE: 41C/CV root finders - Didier Lachieze - 05-21-2015, 11:12 AM
RE: 41C/CV root finders - Dieter - 05-21-2015, 11:40 AM
RE: 41C/CV root finders - Dave Britten - 05-21-2015, 12:51 PM
RE: 41C/CV root finders - Dieter - 05-21-2015, 07:36 PM
RE: 41C/CV root finders - Dieter - 05-22-2015, 08:34 AM
RE: 41C/CV root finders - bshoring - 05-27-2015, 10:09 PM
RE: 41C/CV root finders - Dieter - 05-27-2015, 11:16 PM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 06:19 AM
RE: 41C/CV root finders - Dieter - 05-28-2015, 08:42 AM
RE: 41C/CV root finders - bshoring - 05-28-2015, 09:37 PM
RE: 41C/CV root finders - Ángel Martin - 05-22-2015, 01:14 PM
RE: 41C/CV root finders - Dieter - 05-22-2015, 07:07 PM
RE: 41C/CV root finders - Dieter - 05-24-2015, 07:10 PM
RE: 41C/CV root finders - Ángel Martin - 05-25-2015, 05:35 AM
RE: 41C/CV root finders - Dieter - 05-25-2015, 07:19 PM
RE: 41C/CV root finders - Ángel Martin - 05-26-2015, 05:06 AM
RE: 41C/CV root finders - Dieter - 05-26-2015, 05:39 PM
RE: 41C/CV root finders - Ángel Martin - 05-26-2015, 09:26 PM
RE: 41C/CV root finders - Dieter - 05-26-2015, 10:08 PM
RE: 41C/CV root finders - rprosperi - 05-27-2015, 12:30 AM
RE: 41C/CV root finders - Dieter - 05-27-2015, 11:08 PM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 05:44 AM
RE: 41C/CV root finders - Dieter - 05-28-2015, 09:50 PM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 07:58 AM
RE: 41C/CV root finders - Ángel Martin - 05-27-2015, 05:17 AM
RE: 41C/CV root finders - Dieter - 05-27-2015, 01:50 PM
RE: 41C/CV root finders - Ángel Martin - 05-27-2015, 03:03 PM
RE: 41C/CV root finders - Dieter - 05-27-2015, 07:15 PM
RE: 41C/CV root finders - Dieter - 05-28-2015, 09:59 AM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 11:27 AM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 01:54 PM
RE: 41C/CV root finders - Dieter - 05-28-2015 06:33 PM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 08:04 AM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 05:54 PM
RE: 41C/CV root finders - Dieter - 05-29-2015, 06:15 PM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 06:44 PM
RE: 41C/CV root finders - Dieter - 05-29-2015, 07:19 PM
RE: 41C/CV root finders - Dieter - 05-30-2015, 12:37 PM
RE: 41C/CV root finders - Ángel Martin - 05-30-2015, 02:04 PM
RE: 41C/CV root finders - Dieter - 05-29-2015, 08:00 PM



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