41C/CV root finders
|
05-22-2015, 07:07 PM
(This post was last modified: 05-23-2015 06:39 PM by Dieter.)
Post: #13
|
|||
|
|||
RE: 41C/CV root finders
(05-22-2015 01:14 PM)Ángel Martin Wrote: Here's the formula I used in the TVM Module for the first derivative (as it uses Newton's method): Hmmm... looks like there are some characters missing. ;-) How did you arrive at the formula for the inital guess? For the record, here are the formulas I used for the posted 41C programs. In all cases, k=0 (END) resp. 1 (BEGIN). The initial guess is calculated as follows: Code: s = 2*k - 1 The first program uses a TVM formula close to the definition in the 12C manual. It is evaluated this way: Code: q = 1 + i The second, improved version uses the following formulas: Code: q = 1 + i This way slow operations like powers and logs are reduced to a minimum. Of course the actual implementations use ex–1 and ln(1+x) for better accuracy. Addendum: Here's another way of calculating a first guess for the interest rate. Again, it's simply the first approximation using Newton's method starting at i=0. But this time based on the second TVM definition: Code: s = 2*k - 1 For the test case this leads to an initial estimate of 17,647% (END) resp. 13,044% (BEGIN) while the final solutions are 14,436% resp. 10,205%. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)