12C and its financial algorithms  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: 12C and its financial algorithms (/thread36586.html) 
12C and its financial algorithms  Eduardo  06182003 I found a very interesting article by a UC Berkeley math & engineering professor (W. Kahan) about calculation roundoff errors and poor processor architectures. What's interesting is that he compares HP with TI financial calcs, and he was actually involved in the coding of the *original* 12C's algorithms. I'm posting this as a followup on the controversy about the 12C Platinum's "solving for i". Dr. Kahan's article (pp. 1419) discusses this issue quite in depth (for the original 12C). You can be quite sure the 12C Platinum does not use his beautiful ideas or it would be *at least* as fast as the 12C. I wouldn't be surprised if HP simply "lost" the original coding ideas used for the 12C and tried to reinvent the wheel (and if you read the article, you'll see reinventing *this* wheel isn't quite as simple as it initially appears). The article, called "Mathematics Written in Sand", is linked to from Dr. Kahan's web page at: http://www.cs.berkeley.edu/~wkahan/ The direct URL is: http://www.cs.berkeley.edu/~wkahan/MathSand.pdf
Eduardo
Re: 12C and its financial algorithms  Luc Chanh Truong  06182003 Thank you alot, Eduardo, for your information. It's very interesting.
Re: 12C and its financial algorithms  Tony  06192003 Yep, that's a great article. The 12CP is really a very interesting machine. Every day I see a new bug!<G>. Today I tried n=1 i=.001 PV=100 PMT=0 and solved for FV=99.999 which is correct. But i=.0009 gives FV=100.0009. Yes, plus 100.0009! The answer should be 99.9991. I cannot imagine the coding that would do this magic. The old 12C does this correctly, so it is not something copied over. yesterday I noticed the 12CP does try and cheat when solving for i  but it only goes ahead and does it if the solution is exact. Re: 12C and its financial algorithms  Tony  06192003 On page 15 of Prof kaplan's "Maths in the Sand" is a "Penny for your Thoughts" example with n=31,516,000 i=3.170979198 E7 PV=0 PMT=.01 END: solve for FV=331,667.0067. The 12CP resolves for i in 280 seconds giving i=3.107401823 E7. That's within about E4%. The 12C gives 3.197401823 7 which is 1% out, but it only takes a few seconds. All is not lost on the 12CP though  i did a 250 (the limit, due to a bug) line isolve program that never seems to take longer than 40 seconds  so the 12CP runs the prog well  and for the above case it resolves the i exactly!! Probably a fluke, but shows what the 12CP can do.
Re: 12C and its financial algorithms  Tony  06192003 whoops the 12CP gives 3.170982000 E7 in 280 seconds  a pretty good answer in the end. Only 2.8E13 too high or about E4 % Edited: 19 June 2003, 4:00 a.m.
Re: 12C and its financial algorithms  hugh  06192003 280 seconds! wait! whats's this. here comes the hp9g, cover flapping in the wind... "I'll save you rpn mortals from evil tvm errors..."
"finding FV is easy with my 24 digit precision. don't panic kids, i'll just use the textbook formula fv=amt*((1+i)^n1)/i" "ah! that was easy, now to solve for I in only 5 seconds.. just whisk together a quick solver..."
INPUT L,H,E; "and the solvefor subroutine..."
Y=((1+X)^315360001)*.01/X "put in L=1e30, H=1e7, E=8 and presto!" x=3.1709792e9 which is correct.
Re: 12C and its financial algorithms  eel  06282003 >FV=99.999 which is correct. But i=.0009 gives FV=100.0009
I tried this on my 17BII, and the answer I got is FV=100.009!
Re: 12C and its financial algorithms  Tony  06292003 here the 17bii is fine, n=1,i=.0009,pv=100,pmt=0 gives fv=99.9991.
