Post Reply 
Discount Rate
04-08-2022, 07:44 PM (This post was last modified: 04-09-2022 08:00 AM by Thomas Klemm.)
Post: #2
RE: Discount Rate
There is a bug in the listing.
When calculating

\(
- n (i + 1)^{n - 1}
\)

the multiplication by \( n \) is missing.

In the third column we find:
Code:
rcl 9           2
aˣ rcl 4 =      3
sto - chs       1

Instead it should be:
Code:
rcl 9           2
aˣ rcl 4 =      3
rcl × 7         2
sto - chs       1

Quote:The machine should have a capacity of 98 keystrokes to perform this routine.

With this fix we are at 100 keystrokes.



Instead of using this suggestion I would rather follow how this is done in the HP-80.

Initial Value

\[i_0 = \frac{2(n-P)}{n(n+1)}\]

Newton Iteration

\[
\begin{align}
Z &= (1 + i)^{-n} \\
\\
i_\text{next} &= i \left[ 1 - \frac{iP - (1 - Z)}{1 - Z - \frac{niZ}{1 + i}} \right]
\end{align}
\]

Register

R0: n
R1: P = PV / PMT
R2: i
R3: u = 1 + i
R4: Z = u-n
R5: v = Z - 1


Program

This program is for the HP-25, but can easily be adapted for other models:
Code:
01: 24 00    : RCL 0            ; n
02: 24 01    : RCL 1            ; P
03: 41       : -                ;
04: 02       : 2                ;
05: 61       : *                ;
06: 24 00    : RCL 0            ;
07: 31       : ENTER            ;
08: 15 02    : g x^2            ;
09: 51       : +                ;
10: 71       : /                ; 2 * (n - P) / (n^2 + n)
11: 23 02    : STO 2            ; i
12: 01       : 1                ;
13: 51       : +                ;
14: 23 03    : STO 3            ; u = 1 + i
15: 24 00    : RCL 0            ; n
16: 32       : CHS              ; -n
17: 14 03    : f y^x            ;
18: 23 04    : STO 4            ; Z = u^(-n)
19: 01       : 1                ;
20: 41       : -                ;
21: 23 05    : STO 5            ; v = Z - 1
22: 24 02    : RCL 2            ; i
23: 24 01    : RCL 1            ; P
24: 61       : *                ;
25: 51       : +                ; i * P + v
26: 24 00    : RCL 0            ; n
27: 24 02    : RCL 2            ; i
28: 61       : *                ; n * i
29: 24 04    : RCL 4            ; Z
30: 61       : *                ; n * i * Z
31: 24 03    : RCL 3            ; u
32: 71       : /                ; n * i * Z / u
33: 24 05    : RCL 5            ; v
34: 51       : +                ; v + n * i * Z / u
35: 71       : /                ; (i * P + v)/(v + n * i * Z / u)
36: 01       : 1                ;                                     
37: 51       : +                ; 1 + (i * P + v)/(v + n * i * Z / u)
38: 24 02    : RCL 2            ; i
39: 61       : *                ;
40: 74       : R/S              ; i_next
41: 13 11    : GTO 11           ;

Quote:The procedure is terminated when two successive values differ by less than a pre-set amount. This test can easily be built-in to the program by a conditional if-then-else command sequence if desired and if sufficient capacity is available. A round-off command should be programmed just prior to the test, of course.

Example: True Interest Rate of a Loan

What is the true interest rate on a 36 month loan for $3000 having monthly payments of $100?

FIX 6

36
STO 0

3000
ENTER
100
/
STO 1

CLEAR PRGM
R/S
0.010190

R/S
0.010207

R/S
0.010207


Thus, after only three iterations, we get the result.
We can now calculate the annual percentage rate:

FIX 2

1200
×
12.25


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


Messages In This Thread
Discount Rate - SlideRule - 04-04-2022, 01:54 PM
RE: Discount Rate - Thomas Klemm - 04-08-2022 07:44 PM
RE: Discount Rate - Albert Chan - 04-08-2022, 10:21 PM
RE: Discount Rate - Albert Chan - 04-09-2022, 12:50 PM
RE: Discount Rate - Eddie W. Shore - 04-10-2022, 11:29 PM
RE: Discount Rate - Albert Chan - 04-09-2022, 05:47 PM
RE: Discount Rate - Albert Chan - 04-10-2022, 04:03 AM
RE: Discount Rate - Thomas Klemm - 04-10-2022, 12:19 PM
RE: Discount Rate - Albert Chan - 04-11-2022, 01:18 AM
RE: Discount Rate - Albert Chan - 04-11-2022, 03:11 PM
RE: Discount Rate - Albert Chan - 04-11-2022, 03:57 PM
RE: Discount Rate - Albert Chan - 05-11-2022, 06:22 PM
RE: Discount Rate - Thomas Klemm - 04-11-2022, 02:37 AM
RE: Discount Rate - Thomas Klemm - 04-11-2022, 08:48 PM
RE: Discount Rate - Thomas Klemm - 04-12-2022, 11:11 PM
RE: Discount Rate - Thomas Klemm - 04-12-2022, 11:13 PM
RE: Discount Rate - Thomas Klemm - 04-18-2022, 01:58 PM
RE: Discount Rate - rprosperi - 04-18-2022, 06:41 PM
RE: Discount Rate - Thomas Klemm - 04-18-2022, 07:03 PM



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