Post Reply 
(11C) Solve for [i] given [n] [PMT] [FV]
04-16-2018, 06:24 PM (This post was last modified: 04-16-2018 06:58 PM by Dieter.)
Post: #9
RE: (11C) Solve for [i] given [n] [PMT] [FV]
(04-16-2018 01:41 PM)Gamo Wrote:  [n] [PV] [FV] solve for [i]
GSB > 0
36 > A [n]
-1 > D [PV]
2 > E [FV]
B > 1.94 (Answer [i])

The program also seems to handle simple compound interest (PMT=0) quite well. But here a direct solution exists, and this should be returned by the program. Just change the lines after LBL B this way:

Code:
LBL B
RCL 3
x≠0?
GTO 3
RCL 5
RCL 4
/
CHS
RCL 1
1/x
y^x
1
-
STO 2
GTO 2
LBL 3
RCL 1
x
RCL 4
+
RCL 5
+
...continue with line 021 of the original version 
i.e. RCL 1   1   -   etc.

So goto line 20 of the original program ("+"), delete all lines until you see LBL B and insert the lines above.

Another suggestion: when the program calculates (1+i) and (1+i)^n usually two or more digits are lost. Imagine i=1E–10 so that 1+i rounds to 1 which leads to the same result as if i was zero. That's why checking the relative error in line 78...80 does not always make sense, it can even cause problems as the program may not reach the desired relative accuracy (cf. example 2 in this post in the current TVM thread). So please replace the sequence STO–2 RCL 2 / with a simple STO–2, i.e. remove the two lines with the division by R2.

Here is an example for the mentioned problem which shows that it can occur even with completely "normal" data like i=12% and n=20. The exact result for (1+i)^n is 9,646293093. Buf if i is merely 1E–9 off, i.e. 1+i=1,120000001 instead of 1,12, the power is evaluated as 9,646293266 – only 7 out of 10 digits are exact.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (11C) Solve for [i] given [n] [PMT] [FV] - Dieter - 04-16-2018 06:24 PM



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