Looking for TVM contributions
|
06-19-2024, 09:06 PM
(This post was last modified: 06-19-2024 10:39 PM by Albert Chan.)
Post: #70
|
|||
|
|||
RE: Looking for TVM contributions
(06-19-2024 03:47 PM)robve Wrote: n=480 pv=100000 pmt=-208.333333333333343 fv=0 (-pmt) > (pv/n), by a smudge. I would expect positive rate (0 is good too) Still, -1.4e-17% is not too bad (using fma, true rate = +1.89e-17%) i ≈ 1/p - p/n² = (n²-p²)/(p*n²) = (n+p)*(n-p) / (p*n²) -- where p=-pv/pmt lua> fma(n,pmt,-pv) * fma(n,pmt,pv) / (-pv*pmt*n*n) -- scale by pmt²/pmt² 1.8947806286936e-19 More concerning is huge FVerror, perhaps bug in FV code? n=480 pv=100000 pmt=-208.333333333333343 fv=-5.4e+5 --> solve rate = 0.4598% ? (06-19-2024 12:20 PM)Albert Chan Wrote: Since both Newton and Secant are self-correcting, we can simply look at last 2 points. robve Wrote:How? I don't see it in the experiments. You're assuming the two point npmt values have errors in different directions. Then it is worse. But expression evaluation errors in two close points are highly correlated, not independent. Claiming Secant is going to be much worse in general, i.e. assuming these errors are independent, is a stretch. I said Secant's slope is worse, not Secant's method. Here is an example, Newton's slope with 15 good digits, Secant's slope only 1 Assuming last point from Newton and Secant reach about the same place. Newton final step: x - y / y' Secant final step: x - y / ((y-y0)/(x-x0)) Also, you missed my conclusion. Bad slope might not matter. (06-19-2024 12:20 PM)Albert Chan Wrote: With both methods use the *same* f, and Newton get better f', I would think Newton is better. robve Wrote:I'm not completely happy about the iguess() (it's your guess_i() code by the way), which works fine in END mode, but is not as good in BEGIN mode. It also can return an overflow >100% causing NaN. guess_i() is retired from use. Edge rate is now preferred. Anyway, BEGIN mode {n,pv,pmt,fv} == END mode {n,pv+pmt,pmt,fv-pmt} test sample #1 Wrote:./tvm 40 ? 900 -40 -1000 1 lua> n,pv,pmt,fv = 40,900,-40,-1000 -- BEGIN mode lua> pv,fv = pv+pmt, fv-pmt -- END mode lua> n,pv,pmt,fv 40 860 -40 -960 lua> pmt/fv, pmt/-pv 0.041666666666666664 0.046511627906976744 1 sign changes --> 1 solution, either edge is good. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 10 Guest(s)