PC-1211, PC-1250, etc. TVM
|
06-08-2024, 11:47 PM
(This post was last modified: 06-11-2024 10:59 PM by Albert Chan.)
Post: #34
|
|||
|
|||
RE: PC-1211, PC-1250, etc. TVM
(06-08-2024 09:21 PM)robve Wrote: If you want another bewildering TVM problem: lua> n, pv, pmt, fv = 40, 900, 1000, -1000 lua> pv, fv = pv+pmt, fv-pmt -- Now, b=0 lua> pv, pmt, fv 1900 1000 -2000 Solve with split loan method f(x) = x + (pv+fv) / ((1+i)^n-1), where i = pmt / (x-pv) Code: Loan: n pv pmt fv lua> i = pmt / fv -- "smallest" edge rate = -0.5 With negative i and positive n, ((1+i)^n-1) --> -1, may lose many significant digits So, we flip for time-reversed setup. lua> n, pv, fv = -n, -fv, -pv lua> x = -(pv+fv) / expm1(log1p(i)*n) lua> x -9.094947017737554e-11 i = pmt / (x - pv) = (-pmt/pv) / (1 - (x/pv)) ≈ (-pmt/pv) * (1 + (x/pv)) Since -pv was fv before time-reversal, first term is just old i = -0.5 It also mean old x = 0. No more iteration necessary. lua> i .. ' + ' .. i*(x/pv) -0.5 + 2.2737367544343885e-14 rate (%) = -49.9999999999977262632455656115 Equivalent way, tvm() to get x*i, divide by pv to get i error lua> n,i,pv,pmt,fv -40 -0.5 2000 1000 -1900 lua> tvm(n, i, 0, nil, pv+fv) / pv 2.2737367544343885e-14 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)