Hello Tony,
Thanks for the compliment, but Magnum Opus is a bit exaggerated :-)
For pi/180 I have used 0.01745329252 because it's close to the actual 12-digit constant 0.0174532925199. I tried 0.0174532925198 as you suggested but I noticed no improvement (I obtained 9.00000588157).
Although the last two digits are not truncated anymore, there is a lost of accuracy beginning in the seventh or the eighth significant digit for arguments equal or greater than 0.999999. This appears to be due to floating point errors and doesn't have anything to do with the choice of contants. I have to repeat the same tests in the table below with the older version. In case there isn't any noticeable improvement, perhaps I'll get back to the older version because it's slightly shorter. Anyway, this was a nice exercise for a Saturday afternoon and evening :-)
x HP-32SII HP-25 HP-12CP HP-15C
--------------------------------------------------------------------------------------------------------
0.9999999999 0.000810284684548 0.0008102769138 0.000810284684566 0.0008102846845
0.999999999 0.00256234515652 0.002562324556 0.00256234515715 0.002562345157
0.99999999 0.00810284685217 0.008102826434 0.00810284687236 0.008102846852
0.99999995 0.0181185164331 0.01811852976 0.0181185166595 0.01811851643
0.9999999 0.0256234517765 0.02562347473 0.0256234524170 0.02562345178
0.999999 0.0810284752065 0.08102849351 0.0810284752060 0.08102847521
0.999998 0.114591578125 0.1145916163 0.114591578125 0.1145915781
0.999997 0.140345459308 0.1403455535 0.140345459308 0.1403454593
0.999995 0.181185239070 0.1811854695 0.181185239070 0.1811852391
0.999992 0.229183270841 0.2291830034 0.229183270841 0.2291832708
In this table the results are exact to 12 and 10 digits on the HP-32SII and HP-15C. The HP-25 has errors beginning in the fifth significant digits. In this range the HP-12CP program is closer to the HP-15C than the HP-25. Out of this critical range, the program has no problems. However the HP-25, a commercial product in the mid 70's, presents an error in the tenth significant digit, when computing acos(0.9). Considering I was mostly interested in a fast running program, I am still pleased with the program. It's faster than the russian calculator in the link, if this can be used as a comparison. Of course I am also pleased with the overall accuracy, thanks to the extra digits in the Platinum.
Cheers,
Gerson.
------------------------------------------------
Edited to include this table:
After debugging (by using acos(x) = 2*atan(sqrt((1 - x)/(1+x))), as suggested by Tony):
x HP-32SII HP-25 HP-12CP HP-15C
--------------------------------------------------------------------------------------------------------
0.9999999999 0.000810284684548 0.0008102769138 0.000810284684543 0.0008102846845
0.999999999 0.00256234515652 0.002562324556 0.00256234515651 0.002562345157
0.99999999 0.00810284685217 0.008102826434 0.00810284685213 0.008102846852
0.99999995 0.0181185164331 0.01811852976 0.0181185164330 0.01811851643
0.9999999 0.0256234517765 0.02562347473 0.0256234517764 0.02562345178
0.999999 0.0810284752065 0.08102849351 0.0810284752060 0.08102847521
0.999998 0.114591578125 0.1145916163 0.114591578125 0.1145915781
0.999997 0.140345459308 0.1403455535 0.140345459308 0.1403454593
0.999995 0.181185239070 0.1811854695 0.181185239069 0.1811852391
0.999992 0.229183270841 0.2291830034 0.229183270840 0.2291832708
The older version may be definitely discarded.
Edited: 13 Dec 2006, 3:52 p.m. after one or more responses were posted