Post Reply 
(12C) Actuarial Calculations
05-12-2018, 05:41 AM (This post was last modified: 05-12-2018 06:33 AM by Gamo.)
Post: #1
(12C) Actuarial Calculations
Since HP 12C always calculate [n] as an Integer with rounding up result.
Program below help solve this problem to get result with fractional part and [n] can be input with fractional part by using the Actuarial Method.

*Program to calculate [i] and use fractional [n]
Code:

01  ,
02  0
03  1
04 STO 3
05  1
06 RCL 3
07  1
08  +
09 STO 1
10 RCL [n]
11 CHS
12 Y^X
13 STO 2
14  -
15 RCL 3
16  ÷
17 RCL 3
18 RCL 0
19  x
20  1
21  +
22  x
23 RCL [PMT]
24  x
25 RCL [PV]
26  +
27 RCL [FV]
28 RCL 2
29  x
30  +
31 RCL 2
32 RCL 1
33  ÷
34 RCL [n]
35  x
36 STO 4
37  1
38 RCL 2
39  -
40 RCL 3
41  ÷
42  -
43 RCL [PMT]
44 RCL 3
45  ÷
46  x
47 RCL [FV]
48 RCL 4
49  x
50  -
51  ÷
52 STO-3
53 ENTER
54 CHS
55 X≤Y
56 X<>Y
57 EEX
58 CHS
59  8
60 X≤Y
61 GTO 05
62 RCL 3
63 EEX
64  2
65  x
66 ENTER
67 STO [i]

Example of calculating interest rate required for growth:
A savings account has a balance of $1000. What annual interest rate is required to double the money in 5½ years?

Store 0 in register 0 for END mode; store 1 in register 0 for BEGIN mode.

0 STO 0 > 0 // Set END mode
1000 CHS [PV] > -1000.00
2000 [FV] > 2000.00
5.5 [n] > 5.50
0 [PM]T > 0.00
R/S > 13.43 // Answer

*Program to calculate [n]
Code:

01  1
02 RCL [i]
03  %
04 STO 2
05  +
06 STO 1
07 RCL 0
08 Y^X
09 RCL [PMT]
10  x
11 STO 3
12 RCL [FV]
13 RCL 2
14  x
15  -
16 RCL [PV]
17 RCL 2
18  x
19 RCL 3
20  +
21  ÷
22  LN
23 RCL 1
24  LN
25  ÷
26 STO [n]

Example of calculating compound interest:
A deposit of $150 is made each month in an account paying 6.5 percent, compounding monthly. How long will it take to accumulate $20,000? Assume END mode.

Store 0 in register 0 for END mode; store 1 in register 0 for BEGIN mode.

0 [STO] 0 > 0.00
6.5 g [i] > 0.54
0 [PV]
150 [CHS] [PMT] > -150.00
20000 [FV] > 20000.00
[R/S] > 100.63

This program is from HP Support website.
https://support.hp.com/us-en/document/bpia5043

Remark:
All calculations above work on HP 15C using TVM program from the Advance Functions Handbook.
For HP-12C these two program together use about 95 steps this can enhance 12C TVM functions.

Gamo
Find all posts by this user
Quote this message in a reply
05-12-2018, 07:00 PM
Post: #2
RE: (12C) Actuarial Calculations
(05-12-2018 05:41 AM)Gamo Wrote:  *Program to calculate [i] and use fractional [n]

This seems to be a Newton-style solver that calculates the interest rate iteratively. This requires the usual convergence check: exit if the absolute value of the last change in i is less than 1E–8. Now take a look at line 53...56: here the HP programmer found a nice way to determine the absolute value of x.

Code:
53 ENTER
54 CHS
55 X≤Y
56 X<>Y

Compared with the common method (calculate √x²) this has three advantages: there are no roundoff errors, LastX is preserved and it also works for x ≥ 1E+50.

(05-12-2018 05:41 AM)Gamo Wrote:  Remark:
All calculations above work on HP 15C using TVM program from the Advance Functions Handbook.

Just to be clear – I assume what you want to say is this:

Unlike the 12C, the TVM program in the 15C Advanced Functions Handbook does not round n to the next higher integer, it directly returns a fractional results if required. So the above programs are not needed there.

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




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