Post Reply 
Accuracy of HP Financial Calculators - Canadian mortgage
01-08-2014, 03:20 AM (This post was last modified: 01-08-2014 11:39 AM by Jeff_Kearns.)
Post: #1
Accuracy of HP Financial Calculators - Canadian mortgage
Having recently adapted an 'accurate' (relative term) TVM routine for the HP-15C thanks to Karl Schneider's MISO Technique using indirect addressing, I decided to compare the results for a Canadian mortgage monthly payment with other HP calculator models. For all non-Canadians, interest on mortgages in Canada is compounded semi-annually, but payments are made monthly.

One therefore has to convert the nominal annual interest rate (based on semi-annual compounding) to an effective annual interest rate and then convert it again to an equivalent nominal rate for calculating monthly payments (based on monthly compounding). If you have an HP-12C, the following procedure can be used to obtain the Canadian mortgage factor (from the Owner's Handbook):

The keystrokes to calculate the Canadian Mortgage factor (on the 12C) are:
Press [f ], CLEAR [FIN ], [g ], then END .
Key in 6 and press [n ].
Key in 200 and press ENTER , then PV .
Key in the annual interest rate as a percentage and press [+ ], CHS , then FV .
Press [i ].
The Canadian mortgage factor is now stored in [i ] for future use.

I have a short routine of the above procedure for the 12C and equivalent SOLVER routines for the 17BII and 19BII. The 30b has a built-in Canadian TVM function that does the same with appropriate mode settings. The results from different models (both scientific and financial) are interesting and I welcome any insight as to why they differ the way they do and which is the most 'correct':

Variables
n: 300 months (#payments)
i: 3% (nominal annual interest rate)
PV: $450,000 (mortgage amount)
PMT: UNKNOWN
FV: 0 (fully paid off after 300 months)

Results for monthly payment:
  • HP-15C: $2,129.604821
  • HP-12C: $2,129.604744
  • HP-32SII: $2,129.60474211
  • HP-42S: $2,129.60474211
  • HP-30B: $2,129.60474341
  • HP-19BII: $2,129.60474211
  • HP-17BII: $2,129.60474211

The 15C results are not surprising considering it has less precision. It gives a monthly nominal rate of 0.248451700% whereas the 12C gives 0.248451673 and the HP-32Sii and HP-42S both give 0.248451672% (and so does the 50G). The difference in precision in the 15C likely stems from taking the 12th root of the effective rate when converting to monthly.

What surprises me is the HP-30B... Why does it give a different result from the other high-end financial models? And isn't is surprising how accurate the routine is for the pioneer models 32sii and 42S? How does the WP-34S compare?

Jeff
Find all posts by this user
Quote this message in a reply
01-08-2014, 04:56 AM
Post: #2
RE: Accuracy of HP Financial Calculators - Canadian mortgage
HP-30B: $2,129.60474341

What surprises me is the HP-30B... Why does it give a different result from the other high-end financial models? And isn't is surprising how accurate the routine is for the pioneer models 32sii and 42S? How does the WP-34S compare?



Gene: The 30B result matches Excel's calculations of $2,129.60474341 366 as far as the 30B goes.

As I recall, the 30B has greater internal accuracy in its financial routines.
Find all posts by this user
Quote this message in a reply
01-08-2014, 11:16 AM
Post: #3
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(01-08-2014 04:56 AM)Gene Wrote:  HP-30B: $2,129.60474341

Gene: The 30B result matches Excel's calculations of $2,129.60474341 366 as far as the 30B goes.

As I recall, the 30B has greater internal accuracy in its financial routines.

For what it is worth; the Prime provides the same result as the 30b 2129.60474341

Cheers, Terje
Find all posts by this user
Quote this message in a reply
01-08-2014, 11:34 AM (This post was last modified: 01-08-2014 11:35 AM by Jeff_Kearns.)
Post: #4
RE: Accuracy of HP Financial Calculators - Canadian mortgage
Terje Vallestad wrote: "For what it is worth; the Prime provides the same result as the 30b 2129.60474341"

The 50G gives the same result as the 19BII and Pioneers: 2129.60474211

Jeff
Find all posts by this user
Quote this message in a reply
01-08-2014, 11:42 AM
Post: #5
RE: Accuracy of HP Financial Calculators - Canadian mortgage
To convert from a nominal Canadian annual rate to the effective nominal rate, use:

200
/
LN1+X
6
/
E^X-1
100
*

Then, the HP42S gets the monthly rate as 0.248451672465 and the PMT as -2,129.60474341, just like the 30b

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
01-08-2014, 12:19 PM
Post: #6
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(01-08-2014 04:56 AM)Gene Wrote:  Gene: The 30B result matches Excel's calculations of $2,129.60474341 366 as far as the 30B goes.

As I recall, the 30B has greater internal accuracy in its financial routines.

HP 200LX: $2,129.604743413646
Find all posts by this user
Quote this message in a reply
01-10-2014, 01:02 AM
Post: #7
RE: Accuracy of HP Financial Calculators - Canadian mortgage
The WP-34S matches the HP-30B and the 42S: 2129.60474341. The effective interest rate is: 0.24845167247 (Werner's method gives 0.2484516724648725, so there's that.)

The same result, by the way, using either the original 2 step 12C method, or by setting:
I=3
NP=12
NI=2
Find all posts by this user
Quote this message in a reply
01-10-2014, 01:39 AM (This post was last modified: 01-10-2014 04:32 AM by Jeff_Kearns.)
Post: #8
RE: Accuracy of HP Financial Calculators - Canadian mortgage
Your statement:
(01-10-2014 01:02 AM)DMaier Wrote:  The effective interest rate is: 0.24845167247
is incorrect.

I am not a financial type - I am an engineer. But I think it is important to make a note on terminology. That value: 0.24845167247%, is actually the 'nominal' monthly rate, not the 'effective' interest rate. If you multiply it by 12, you get 2.98142007%, the nominal annual rate for monthly payment calculations.

The stated 'nominal' annual rate for Canadian mortgages is based on a semi-annual compounding period - and is 3% in this particular example. This translates into an 'effective' annual interest rate of 3.0225%.

The 'effective' interest rate is always greater than the nominal rate. There are in fact, three 'rates' at play here...
> The posted 'nominal' rate of 3%, based on semi-annual compounding;
> The 'effective' annual interest rate of 3.0225%; and
> The 'nominal' rate of 2.98142007%, used for the calculation of monthly payments.

Effective Annual Interest Rate Explained

Regards,

Jeff
Find all posts by this user
Quote this message in a reply
04-07-2014, 02:12 AM (This post was last modified: 04-07-2014 08:50 PM by solwarda.)
Post: #9
RE: Accuracy of HP Financial Calculators - Canadian mortgage
The nominal monthly rate for Canadian mortgages can be calculated as follows:
3%/200 + 1 =1.015^(1/6)=1.0024845167 2464872638 - 1.

The Formula for the monthly payment is: $450,000 x .0024845167 2464872638 x (1.0024845167 2464872638)^300/((1.0024845167 2464872638^300) - 1)=
$2129.6047434136 4549091198.
As can be seen from these extended precision calculations, it all depends on how many decimal places is the calculation carried out internally inside each calculator.
Find all posts by this user
Quote this message in a reply
04-07-2014, 03:31 AM
Post: #10
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(04-07-2014 02:12 AM)solwarda Wrote:  3%/200 + 1 =1.015^(1/6)=1.0024845167 2464872638 - 1.
ಠ_ಠ
That's not how equations work.
Find all posts by this user
Quote this message in a reply
04-07-2014, 04:39 AM
Post: #11
RE: Accuracy of HP Financial Calculators - Canadian mortgage
Thomas Klemm: I don't quite understand your objection. I'm simply converting 3% nominal annual rate compounded semi-annually into a monthly nominal rate for the purpose of calculating the requisite monthly payment. You can do this in a number of ways. For example, you can compound 3% semi-annual rate into "effective" annual rate as follows: 3/200=.015 +1=1.015^2=1.030225-1 x 100=3.0225, which is the effective annual rate. Then you can take the 12th root of that, which will give you the above nominal monthly rate.
Find all posts by this user
Quote this message in a reply
04-07-2014, 05:19 AM
Post: #12
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(04-07-2014 04:39 AM)solwarda Wrote:  Thomas Klemm: I don't quite understand your objection.
Equality is a transitive relation. By chaining the calculations you create equations that don't hold. You just have to split them:
3%/200 + 1 = 1.015
1.015^(1/6) = 1.0024845167 2464872638
1.0024845167 2464872638 - 1 = 0.0024845167 2464872638
So nothing wrong with the calculation. Just with the use of the = sign.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
04-07-2014, 07:06 PM
Post: #13
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(04-07-2014 02:12 AM)solwarda Wrote:  The Formula for the monthly payment is...

...missing some brackets. Otherwise the two identical powers cancel down to 1. ;-)

Quote:0.0024845167 2464872638

The true value is ...639. Or ...638916... to be precise. Using ln1+x and e^x–1 ensures the required accuracy here.

Quote:$2129.6047434136 4549091198.

The WP34s in DP mode returns 2.129,6047 4341 3645 4909 1198 5546 8796 57

Quote:As can be seen from these extended precision calculations, it all depends on how many decimal places is the calculation carried out internally inside each calculator.

You bet. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
04-07-2014, 07:49 PM (This post was last modified: 04-07-2014 08:13 PM by Dieter.)
Post: #14
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(01-08-2014 03:20 AM)Jeff_Kearns Wrote:  
  • HP-15C: $2,129.604821
  • HP-12C: $2,129.604744
  • HP-32SII: $2,129.60474211
  • HP-42S: $2,129.60474211
  • HP-30B: $2,129.60474341
  • HP-19BII: $2,129.60474211
  • HP-17BII: $2,129.60474211
The 15C results are not surprising considering it has less precision. It gives a monthly nominal rate of 0.248451700% whereas the 12C gives 0.248451673 and the HP-32Sii and HP-42S both give 0.248451672% (and so does the 50G).

Both the 42s and the 50G feature ln1+x and e^x-1, so they are able to obtain the correct 12-digit interest rate as 0,248451672465%. This again leads to the correct result, which in the above list is exclusively returned by the 30B.

So if the 12-digit machines don't get it right it's not their fault. It's sloppy programming in case of the 42s and 50G. Calculators that do not offer ln1+x need a workaround to get similar accuracy.

Quote:What surprises me is the HP-30B... Why does it give a different result from the other high-end financial models?

While most HPs internally use three additional guard digits (for internal calculations, that is - not in a TVM user program), the 30B IIRC internally uses much more digits. On the other hand the correct result can be obtained with simple 12-digit accuracy (e.g.42s, 50G) - careful programming provided:

Code:
 3 [ENTER] 200 [/]  =>   0,015
 [ln1+x]            =>   0,0148886124938
 6 [/]              =>   0,00248143541563
 [e^x-1] 100 [x]    =>   0,248451672465

Edit: I now see that Werner already mentioned this point in his post. ;-)

Users with hyperbolic functions, but without ln1+x and e^x-1 may do it this way:

Code:
 3 [ENTER] 200 [/]         =>   0,015
 [ENTER] [ENTER] 2 [+] [/] =>   0,00744416873449
 [HYP] [ATAN] 2 [x]        =>   0,0148886124937
 6 [/]                     =>   0,00248143541562
 2 [/] [HYP] [SIN]
 [LastX] [e^x] [x]         =>   0,00124225836232
 200 [x]                   =>   0,248451672464

Compare this with the result of less careful evaluation:
Code:
 1,015 [ENTER] 6 [1/x] [y^x] => 1,00248451672   (maybe ...673)
 1 [–] 100 [x]               => 0,248451672000

Which means that three valuable digits are lost!

Quote:And isn't is surprising how accurate the routine is for the pioneer models 32sii and 42S?

I do not think that nine out of twelve digits is particulary accurate. But again: that's not the fault of the calculator.

Quote:How does the WP-34S compare?

With 16 or even 34 digit precision (and careful programming) you can expect accuracy far beyond the previous examples:

 i% = 0,2484 5167 2464 8726 3891 6130 7363 4707 27
PMT = 2.129,6047 4341 3645 4909 1198 5546 8796 57

Dieter
Find all posts by this user
Quote this message in a reply
04-07-2014, 08:42 PM
Post: #15
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(01-08-2014 03:20 AM)Jeff_Kearns Wrote:  The 15C results are not surprising considering it has less precision.
Using Werner's method to calculate i% directly and using the improved version of your TVM program I got the same result for PMT as with the HP-12C.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
04-07-2014, 09:06 PM
Post: #16
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(04-07-2014 07:49 PM)Dieter Wrote:  
Code:
 3 [ENTER] 200 [/]         =>   0,015
 [ENTER] [ENTER] 2 [+] [/] =>   0,00744416873449
 [HYP] [ATAN] 2 [x]        =>   0,0148886124937
In this case you don't gain anything but loose accuracy compared to:
Code:
 3 [ENTER] 200 [/] 1 [+]    =>   1.015
 [LN]                       =>   0.0148886124938

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
04-07-2014, 09:14 PM
Post: #17
RE: Accuracy of HP Financial Calculators - Canadian mortgage
Dieter: If you want the final answer accurate to 100 digits!, here it is:

$2,129.6047434136 4549091198 5546879656 9409506602 5105604773 4028771274 1867975760 1238046591 3606995240 188946.

PS: I can give it to you up to a million digits!.

Cheers!,
Sol
Find all posts by this user
Quote this message in a reply
04-07-2014, 09:20 PM
Post: #18
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(04-07-2014 07:49 PM)Dieter Wrote:  Both the 42s and the 50G feature ln1+x and e^x-1, so they are able to obtain the correct 12-digit interest rate as 0,248451672465%. This again leads to the correct result, which in the above list is exclusively returned by the 30B.

So if the 12-digit machines don't get it right it's not their fault. It's sloppy programming in case of the 42s and 50G. Calculators that do not offer ln1+x need a workaround to get similar accuracy.

Thank you for this excellent reply! Although it has been 3 months since my original post, I have learned something valuable about calculator precision and the use of ln1+x, e^x-1, and hyperbolic workarounds to get the most out my calculators.

The HP-15C result is now the same as that of the 12C (to ten digits), the 42s correct to 12 digits, and the 32sII correct to 11 digits. My programming will be just a little less sloppy from here on in!

Jeff Kearns
Find all posts by this user
Quote this message in a reply
04-07-2014, 10:03 PM (This post was last modified: 04-07-2014 10:19 PM by Dieter.)
Post: #19
RE: Accuracy of HP Financial Calculators - Canadian mortgage
(04-07-2014 09:06 PM)Thomas Klemm Wrote:  In this case you don't gain anything but loose accuracy ...

Sure. The correct ln(1+x) result is no problem if 1+x can be given exactly, i.e. here 1,015 = 1,01500000000.
Now try this with the same 12 digits for i = 4/3% or 1/7% . ;-)

Dieter
Find all posts by this user
Quote this message in a reply
04-07-2014, 11:16 PM
Post: #20
RE: Accuracy of HP Financial Calculators - Canadian mortgage
But it's still good to know when you better avoid it.
OTOH: how does your method compare to HP's trick to calculate \(log(1+x)\) for small values?

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




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