I received yesterday my HP 12c Platinum 25th Anniversary Edition from Samson Cables. I tried my own trigs program on it and was not
pleased with the speed:
2.8 s for SIN and COS, 3.4 s for inverse trigs are not so bad but 5.4 s for TAN is too much!
Now the constants needed by the program are not built-in anymore. Instead, they have to be loaded by means of an optional or
manually stored into registers 7 through .5 when needed. On the other hand, the program is now about 33% faster, still not so fast
but more acceptable for occasional calculations. The main 191-step long program can fit in earlier 12C Platinums but it has not been
tested on them yet.
Best regards,
Gerson.
-----------------------------------
TRIGONOMETRIC FUNCTIONS ON THE 12C PLATINUM
001- 2 063- Rv 125- g LSTx 187- x<>y 246- 9
002- STO 6 064- CHS 126- g x<=y 188- - 247- 1
003- Rv 065- 9 127- g GTO 130 189- RCL 5 248- 6
004- x<>y 066- 0 128- 1/x 190- * 249- 0
005- STO .0 067- + 129- 9 191- RCL 7 250- 6
006- x<>y 068- g GTO 004 130- 0 192- g x=0 251- EEX
007- 9 069- STO .0 131- STO 6 193- g GTO 200 252- 1
008- 0 070- x<>y 132- x<>y 194- x<>y 253- 4
009- g x<=y 071- STO 9 133- 2 195- CHS 254- CHS
010- g GTO 014 072- 1 134- ENTER 196- 9 255- STO .4
011- CHS 073- STO 6 135- 3 197- 0 256- 3
012- g x<=y 074- RCL .0 136- g SQRT 198- + 257- .
013- g GTO 019 075- g GTO 007 137- STO 9 199- x<>y 258- 2
014- 2 076- CLx 138- - 200- x<>y 259- 8
015- * 077- STO 6 139- x<>y 201- RCL .0 260- 1
016- x<>y 078- x<>y 140- g x<=y 202- x<>y 261- 8
017- - 079- RCL .0 141- g GTO 153 203- g GTO 000 262- 3
018- g GTO 020 080- g GTO 064 142- ENTER 263- 7
019- Rv 081- x<>y 143- ENTER 264- 6
020- STO 8 082- RCL .0 144- RCL 9 265- 1
021- g x^2 083- x<>y 145- * 204- 1 266- 4
022- ENTER 084- / 146- 1 205- . 267- EEX
023- ENTER 085- RCL 9 147- - 206- 7 268- 8
024- ENTER 086- x<>y 148- x<>y 207- 4 269- CHS
025- RCL .2 087- g GTO 000 149- RCL 9 208- 5 270- STO .5
026- * 088- 0 150- + 209- 3 271- .
027- RCL .3 089- STO 7 151- / 210- 2 272- 0
028- - 090- Rv 152- 3 211- 9 273- 7
029- * 091- x<>y 153- 0 212- 2 274- 8
030- RCL .4 092- STO .0 154- STO 8 213- 5 275- 4
031- + 093- x<>y 155- x<>y 214- 2 276- CHS
032- * 094- ENTER 156- STO 9 215- EEX 277- STO .6
033- RCL .5 095- g x^2 157- g x^2 216- 2 278- .
034- - 096- 1 158- ENTER 217- CHS 279- 1
035- * 097- - 159- ENTER 218- STO .1 280- 1
036- RCL .1 098- g x=0 160- ENTER 219- 2 281- 0
037- 3 099- g GTO 104 161- RCL .6 220- . 282- 3
038- / 100- CHS 162- * 221- 0 283- 5
039- + 101- g SQRT 163- RCL .7 222- 9 284- 1
040- RCL 8 102- / 164- + 223- 4 285- STO .7
041- * 103- g GTO 117 165- * 224- EEX 286- .
042- ENTER 104- x<>y 166- RCL .8 225- 2 287- 1
043- g x^2 105- 9 167- - 226- 6 288- 4
044- 4 106- 0 168- * 227- CHS 289- 2
045- * 107- * 169- RCL .9 228- STO .2 290- 8
046- CHS 108- g GTO 191 170- + 229- 4 291- 3
047- 3 109- 1 171- * 230- . 292- 7
048- + 110- g GTO 089 172- 3 231- 4 293- 9
049- * 111- 0 173- 1/x 232- 7 294- 6
050- RCL 6 112- STO 7 174- - 233- 5 295- STO .8
051- 2 113- Rv 175- * 234- 6 296- .
052- g x<=y 114- x<>y 176- 1 235- 5 297- 1
053- g GTO 058 115- STO .0 177- + 236- EEX 298- 9
054- Rv 116- x<>y 178- RCL 9 237- 2 299- 9
055- g x=0 117- ENTER 179- * 238- 0 300- 9
056- g GTO 081 118- g x^2 180- RCL .1 239- CHS 301- 9
057- g GTO 076 119- g SQRT 181- / 240- STO .3 302- 9
058- Rv 120- g x=0 182- RCL 8 241- 5 303- 8
059- x<>y 121- g GTO 191 183- + 242- . 304- 3
060- g GTO 201 122- / 184- RCL 6 243- 5 305- 3
061- 2 123- STO 5 185- g x=0 244- 5 306- STO .9
062- STO 6 124- 1 186- x<>y 245- 3 307- g GTO 000
SIN: R/S (-180 <= x <= 180)
COS: g GTO 061 R/S (-180 <= x <= 180)
TAN: g GTO 069 R/S (-180 <= x <= 180)
ASIN: g GTO 088 R/S (-1 <= x <= 1)
ACOS: g GTO 109 R/S (-1 <= x <= 1)
ATAN: g GTO 111 R/S (-9.99...E49 <= x <= 9.99...E49)All angles are in DEGREES. Use RCL .1 (pi/180) to convert to and from radians.
Steps 204 through 307 are optional and allow for automatic loading of the constants used by the program (g GTO 204 R/S).
This should be done before running the program for the first time or when registers .1 through .9 have been changed or
cleared.The only angular mode is DEGREES. Use RCL 7 (pi/180) to convert to
and from radians.In case you decide not to enter the optional steps, either because you have an earlier 12C Platinum which does not handle
large programs or because you need programming memory for something else, you should store the constants manually in the following registers:R.1: 1.745329252E-02 (pi/180)
R.2: 2.094E-26
R.3: 4.47565E-20
R.4: 5.55391606E-14
R.5: 3.281837614E-08 (sine polynomial coefficients)
R.6: -0.0784
R.7: 0.110351
R.8: 0.14283796
R.9: 0.199999833 (arctangent polynomial coefficients)
(another coefficient, 1/3, is included in the program, at lines 172 and 173)The registers 5 through .0 are used by the program as temporary variables. Registers 0 through 4 and the financial registers are always available to the user. The stack register X is saved before running the program, which allows for limited chain calculations
(1 level only).Timing
SIN, COS: ~ 1.7 s
TAN: ~ 3.4 s
ASIN, ACOS, ATAN: ~ 2,5 sSample calculations
First set the display to FIX 9 mode:
f 9
1) asin(acos(atan(tan(cos(sin(9)))))):
Keystrokes Display
9 9.
R/S 0.156434465
g GTO 061 R/S 0.999996273
g GTO 069 R/S 0.017455000
g GTO 111 R/S 0.999996273
g GTO 109 R/S 0.156434462
g GTO 088 R/S 8.9999997952) sin230 + cos230:
Keystrokes Display
30 R/S 0.500000000
g x2 0.250000000
30 g GTO 061 R/S 0.866025404
g x2 0.750000000
+ 1.0000000003) tan 0.15 rad:
Keystrokes Display
.15 RCL .1 0.017453293 (pi/180)
/ 8.594366927
g GTO 069 R/S 0.151135218Accuracy comparison with other HP calculators
Sin(x):
x (deg) HP-15C HP-12CP HP-35
---------------------------------------------------------------
0.000000 0.0000000000 0.0000000000 0.0000000000
0.000010 1.745329252E-07 1.745329252E-07 1.745000000E-07
0.000110 1.919862177E-06 1.919862177E-06 1.919800000E-06
0.022000 3.839724260E-04 3.839724260E-04 3.839723910E-04
3.330000 5.808674960E-02 5.808674960E-02 5.808674960E-02
14.44000 0.2493660251 0.2493660251 0.2493660250
25.55000 0.4312985870 0.4312985870 0.4312985871
36.66000 0.5970652564 0.5970652564 0.5970652561
47.77000 0.7404527827 0.7404527827 0.7404527828
58.88000 0.8560867283 0.8560867283 0.8560867285
69.99000 0.9396329127 0.9396329127 0.9396329127
81.11000 0.9879868528 0.9879868528 0.9879868527
88.88000 0.9998089500 0.9998089500 0.9998089499
89.99900 0.9999999998 0.9999999999 0.9999999998
89.99990 1.0000000000 1.0000000000 1.0000000000
90.00000 1.0000000000 1.0000000000 1.0000000000Tan(x):
x (deg) HP-15C HP-12CP HP-35
---------------------------------------------------------------
0.000000 0.0000000000 0.0000000000 0.0000000000
0.000010 1.745329252E-07 1.745329252E-07 1.745000000E-07
0.000110 1.919862177E-06 1.919862177E-06 1.919800000E-06
0.022000 3.839724543E-04 3.839724543E-04 3.839724542E-04
3.330000 5.818499267E-02 5.818499267E-02 5.818499260E-02
14.44000 0.2575006491 0.2575006491 0.2575006490
25.55000 0.4780471798 0.4780471798 0.4780471798
36.66000 0.7442915883 0.7442915883 0.7442915880
47.77000 1.101686578 1.101686578 1.101686578
58.88000 1.656411391 1.656411391 1.656411391
69.99000 2.745986117 2.745986117 2.745986119
81.11000 6.393166451 6.393166451 6.393166426
88.88000 51.15042993 51.15042993 51.15042860
89.99900 57295.77951 57295.77951 57296.55162
89.99990 572957.7951 572957.7951 573019.3057
90.00000 9.999999999E+99 Error 0 9.999999999E+99ArcTan(x):
x HP-15C HP-12CP HP-35
---------------------------------------------------------------
0.00000 0.0000000000 0.0000000000 0.0000000000
0.00011 6.302535721E-03 6.302535721E-03 6.302535688E-03
0.15500 8.810732986 8.810732986 8.810732984
0.26795 15.00004317 15.00004317 15.00004317
0.41421 22.49982578 22.49982578 22.49982579
0.57735 29.99998843 29.99998843 29.99998843
0.77700 37.84720677 37.84720677 37.84720676
0.88800 41.60507646 41.60507646 41.60507646
1.00000 45.00000000 45.00000000 45.00000000
1.22200 50.70548702 50.70548702 50.70548702
1.48880 56.11145723 56.11145723 56.11145722
2.11100 64.65265735 64.65265735 64.65265735
4.88800 78.43782359 78.43782359 78.43782360
7.55500 82.46000683 82.46000683 82.46000679
99.9990 89.42705557 89.42705557 89.42705555
3333333 89.99998281 89.99998281 89.99998281
-------------------------------------
Edited to add missing information... and to fix two typos in the listing, sorry! Also the program has been slightly changed: now ACOS accepts negative arguments.
Jul/31: Edited again to include more accurate version. SIN, COS and TAN are granted to be accurate in the range from -180 to 180 degrees.
Edited: 31 July 2006, 11:51 a.m. after one or more responses were posted