A couple of TVM-routines for the TI-80
[Prev][Next][Index][Thread]
A couple of TVM-routines for the TI-80
-
Subject: A couple of TVM-routines for the TI-80
-
From: Madsen, Anders <anders.madsen@POST3.TELE.DK>
-
Date: Mon, 30 Sep 1996 11:26:37 +-100
-
In-Reply-To: <>
Being a poor student with the need for some TVM-calculations and without =
money enough to buy a TI-83 <sigh.wav>, I decided to "learn" my humble =
TI80 how to deal with these matters.=20
Now that the work is done, I thought I'd share it - you should be able =
to run it on any TI-8X, but I suppose that using SOLVE with the original =
equation would be somewhat easier.=20
Let me know, if you find errors, find things to improve, think it's =
useful...whatever! :-)
These routines uses 4 variables:
P =3D PV (present value)
M =3D PMT (payment)
N =3D N (number of periods)
I =3D I or IRR (interest)
PROGRAM:PV
:(M/I)-(M(I+1)^-N/I)->P
PROGRAM:PMT
:(I(P((I+1)^N)))/(((I+1)^N)-1)->M
PROGRAM:NPER
:(LN -(M/(IP-M)))/(LN (I+1))->N
PROGRAM:IRR
:0.1->I Basic value for I
:0.1->Z Initial increment value for I
:P->V Store the original PV-value
:
:LBL A
:PRGM_PV Find PV for I=3D0.0001
:IF P<V If PV(I) is smaller than the original PV,=20
the correct answer is somewhere between I and I-Z
:IF Z<1E-4 Check for accuracy - a value of -4 will give us
the answer in the form of 0.1234, which ought to=20
be close enough (computation time: approx. 5 sec.)
:GOTO B If the Z is 1E-4, we jump to B (end of program),
:I-Z->I otherwise we restore I to its previous value and
:Z/10->Z divides Z with 10 to increase the accuracy.
:END End of "IF P<V"-loop
:I+Z->I PV(I) is higher than the original PV, so IRR=20
is still to low - we increase it with Z and
:GOTO A go back to A and give it another try.
:
:LBL B The correct IRR is now somewhere between I and I+Z,
:V->P so we restores P to its original value,
:DISP I displays IRR and
:STOP ends the program.
How to use it:
You go to your bank and borrow $10.000. The interest is 10% per rate and =
you repay the loan over 20 rates. How much do you pay per rate?
10000->P
0.10->I
20->N
PRGM_PMT
1174.596248
- that is, approx. $1.175 per rate.
You buy a new stereo - $1.000 - and the salesman makes you an offer: =
Only 12 easy rates, $99 per month...it's a bargain! Hmmm...what's the =
actual interest paid?
1000->P
12->N
99->M
PRGM_IRR
.0276
- he is charging you 2,76% per month!