Looking for TVM contributions
|
06-15-2024, 03:05 AM
(This post was last modified: 06-16-2024 12:47 PM by robve.)
Post: #44
|
|||
|
|||
RE: Looking for TVM contributions
I've compiled a comparison as an addendum to my previous post.
The Secant code is as before, with the main parts being: Code: i = iguess(); The Newton code main parts, where I've made sure the convergence test doesn't quit early: Code: i = iguess(); The npmt function: Code: double npmt() To compare the root finding error of the rate between these methods, I've computed the new FV given the rate found and compared it to the TVM input FV. The absolute error of the FV is larger when the rate is less accurate. Code: printf(" %.2g\n", fabs(fv - (k*pmt*r/j-pv)/s)) The absolute error of FV is zero when the rate found is accurate, perhaps not to the last digit, but at least so it can be used to compute accurate TVM solutions for PV, PMT and FV. Why FV? The FV appears to be more sensitive to rate errors than PV and PMT, i.e. those can have a zero error when FV has a nonzero error. I will post updated results. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 13 Guest(s)