Musings and comments about our common interest

Published on by JGD
## HP12c accuracy in AMORT calculations

Read entire post

While preparing some explanations on how to use the TVM feature of the HP12c, I found a disconcerting difference:

**Loan calculation:** monthly payment, 200.000€ initial amount, 20 years, complete payment, 6% annual interest, END mode. In brackets, actual keystrokes.

n => 20*12 = 240 [ 20 g n]

i => 6/12 = 0,5% [ 6 g i ]

PV => 200000 [ 200000 PV]

FV => 0 [ 0 FV]

Calculate monthly payment: [ PMT ] => -1432,86

**Loan calculation 2:** with the above data, how much will it be left to pay at the end of year 10 ?

n => 10*12 = 120 [ 10 g n]

Calculate future value with same interest and payment: [ FV ] => **-129062,84 of principal. **

**Loan calculation 3: **how much have we paid of interest and principal in the first 10 years:

Follow the loan calculation 1 steps to make sure everything is in its place with the original numbers;

[ 120 f AMORT] => -101006,34 (interest paid)

[ x<>y ] => 70936,86 (capital paid)

Pressing now [ RCL PV ] shows what is left to pay: **129063,14.** This number is** different by 0,301** to the number above. It however adds up to 200000 with the capital paid above.

This took me a long time to understand, and I also checked with other calculators: the original 12c, HP17bII+, HP19bII...all of them reproduced this difference.

I ended up asking Gene Wright, probably the most knowledgeable in the crossroad of HP calculators and Finance math. He came back with the most likely explanation: the calculation depends on how many decimals you set. I had set 2 decimals for the HP12c, and the firmware takes that as the exact amount paid in each monthly, payment, not using the hidden accuracy of the full mantissa. This was proven by setting the number of decimals to 9: both calculations coincide.

There is an additional comment: the AMORT calculation for 120 periods was instantaneous in the latest HP12c, but took more than half a minute in the original HP12c !! I was not used to wait ! I will now continue with other HP12c features, like IRR and NPV

Published on by JGD
## The TVM formula

Read entire post

I have a son studying engineering and who is now having some finance subjects as part of his major. Today he asked me about a finance problem, which involved, at first sight, two Time Value of Money steps. He was getting a wrong result and he asked me how to do it.

I solved it with a HP12c quite fast - he was surprised how a such small calculator could do it so simply. Then I remembered that the HP Prime that my son has, there is a Finance app! I guided him through it and he was surprised that it could be so fast and practical. I am still interested on his delving deep into the formulae and understanding the math behind - and not just use the solver (which solved his problem in two steps).

From hpmuseum.org:

n number of periods i interest rate PMT periodic payment PV present value FV future value B/E BEGIN/END

Solve equation: PMT*(i1-1)*(1/i+p)+PV*i1+FV=0 where (i1-1) = e1^(n*ln1(i)) and i1 = e^(n*ln1(i)) and ln1(x) = ln(1+x) and e1(x) = e^x-1 p=0 for END, p=1 for BEGIN

The use of ln1+x and e^x-1 prevents the loss of significant digits for small values of i. Consider these extreme examples for accuracy checking:

Example 1:

More about:
TVM