Post Reply 
Plus42 Equations, Preview Release
06-08-2022, 10:47 PM
Post: #727
RE: Plus42 Equations, Preview Release
(06-08-2022 08:48 PM)Thomas Okken Wrote:  1.0.6 is out now, all platforms, with the special case for PMT=0.

h=0 bug is still there, just now not from first guess.
It is possible a nonzero rate guess, coupled with correction, produce an iteration of 0%
It might be the second iteration, or third ...

Example: n, pv, pmt, fv = 10, 1000, -600, 5650.23

i0 = pmt/fv = −0.10619037 (guess)
i1 = i0 - f/f' = −0.00000006
i2 = i1 - f/f' = +0.03263217
i3 = i2 - f/f' = +0.03612254
i4 = i3 - f/f' = +0.03616164

Instead of special cased PMT=0, we may be better off with say, h = 1E-6
We don't need really tiny h. With guess rate from the edge, f is relatively straight.

f = NPMT/n = ((pv+fv)/expm1(n*log1p(x))+pv)*x + pmt

plot (6650.23/(expm1(10*log1p(x)))+1000)*x-600, x = -0.106 .. 0.6
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plus42 Equations, Preview Release - Albert Chan - 06-08-2022 10:47 PM



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