Here is a new trigonometric functions program for the new 12C Platinum. Are there another
designed specifically for this calculator? This is based on MiniMax Polynomial Approximation
(Thanks to Valentin Albillo who's shed some light on the subject) and drastic range
reductions ([0..pi/12] for arctangent function). The program is focused on accuracy and easy
of use. Arguments are entered in degrees and there is an entry-point for each function.
There are neither constants to be previously stored nor initialization routines. Placing the
constants directly into the program rather than recalling them from registers slows down
program execution but considering the new 12C Platinum is faster, this should not be a
problem. Actually this program has not been tested on the new 12C Platinum. Instead, it has
been tested with a very close version suitable for the 15C. Hopefully, I have made no
mistakes in adapting it to the Platinum. I just hope the new Platinum is at least five times
faster than the golden 12C so no function takes longer than two to three seconds to run.
Cos(x) is calculated as Sin(90-x) for the sake of accuracy. As the program is more than 255
lines long it will not work on the old Platinum unless some modifications are made (such as
replacing the last two or three constants in the program for registers recalls).The accuracy is comparable with that of the HP-35. Cos(x) is calculated as Sin(90-x) for the
sake of accuracy. The program gives at least nine significant figures, many times matching
the 15C results. Also, the stack register X is always saved. So, the following expressionasin(acos(atan(tan(cos(sen(9))))))
may be evaluated as:
9 R/S GTO 090 R/S GTO 100 R/S GTO 153 R/S GTO 137 R/S GTO 119 R/S
The result in the 15C with the equivalent program is 8.999661629
That's all for the while,
Gerson.
TRIGONOMETRIC FUNCTIONS ON THE 12C PLATINUM001 2 055 . 109 x<>y 163 1 217 1
002 STO 1 056 8 110 RCL 4 164 g LASTx 218 4
003 Rv 057 1 111 GTO 093 165 g x<=y 219 2
004 x<>y 058 7 112 x<>y 166 GTO 169 220 8
005 STO 4 059 7 113 RCL 4 167 1/x 221 3
006 x<>y 060 6 114 x<>y 168 9 222 7
007 STO 2 061 4 115 / 169 0 223 9
008 g x^2 062 1 116 RCL 3 170 STO 1 224 6
009 ENTER 063 7 117 x<>y 171 x<>y 225 -
010 ENTER 064 3 118 GTO 000 172 2 226 *
011 ENTER 065 EEX 119 x<>y 173 ENTER 227 .
012 4 066 3 120 STO 4 174 3 228 1
013 . 067 CHS 121 x<>y 175 SQRT 229 9
014 4 068 + 122 ENTER 176 STO 3 230 9
015 5 069 RCL 2 123 g x^2 177 - 231 9
016 0 070 * 124 1 178 x<>y 232 9
017 2 071 ENTER 125 - 179 g x<=y 233 9
018 CHS 072 g x^2 126 g x=0 180 GTO 192 234 8
019 EEX 073 4 127 GTO 132 181 ENTER 235 3
020 2 074 * 128 CHS 182 ENTER 236 2
021 0 075 CHS 129 SQRT 183 RCL 3 237 +
022 CHS 076 3 130 / 184 * 238 *
023 * 077 + 131 GTO 156 185 1 239 3
024 5 078 * 132 x<>y 186 - 240 1/x
025 . 079 RCL 1 133 9 187 x<>y 241 -
026 5 080 2 134 0 188 RCL 3 242 *
027 5 081 g x<=y 135 * 189 + 243 1
028 3 082 GTO 087 136 GTO 268 190 / 244 +
029 8 083 Rv 137 x<>y 191 3 245 RCL 3
030 3 084 g x=0 138 STO 4 192 0 246 *
031 9 085 GTO 112 139 x<>y 193 STO 2 247 5
032 EEX 086 GTO 107 140 g x=0 194 x<>y 248 7
033 1 087 Rv 141 GTO 150 195 STO 3 249 .
034 4 088 x<>y 142 SQRT 196 g x^2 250 2
035 CHS 089 GTO 268 143 g x^2 197 ENTER 251 9
036 + 090 2 144 g x^2 198 ENTER 252 5
037 * 091 STO 1 145 1/x 199 ENTER 253 7
038 3 092 Rv 146 1 200 . 254 7
039 . 093 g x^2 147 - 201 0 255 9
040 2 094 SQRT 148 SQRT 202 7 256 5
041 8 095 CHS 149 GTO 156 203 8 257 1
042 1 096 9 150 9 204 4 258 *
043 8 097 0 151 0 205 CHS 259 RCL 2
044 3 098 + 152 GTO 268 206 * 260 +
045 7 099 GTO 004 153 x<>y 207 . 261 RCL 1
046 5 100 STO 4 154 STO 4 208 1 262 g x=0
047 8 101 x<>y 155 x<>y 209 1 263 g x<>y
048 1 102 STO 3 156 ENTER 210 0 264 g x<>y
049 EEX 103 1 157 g x^2 211 3 265 -
050 8 104 STO 1 158 SQRT 212 5 266 RCL 0
051 CHS 105 RCL 4 159 g x=0 213 1 267 *
052 - 106 GTO 007 160 GTO 268 214 + 268 RCL 4
053 * 107 CLx 161 / 215 * 269 x<>y
054 5 108 STO 1 162 STO 0 216 . 270 GTO 000
SIN: R/S (-90 <= x <= 90)
COS: GTO 090 R/S (-180 <= x <= 180)
TAN: GTO 100 R/S (-90 <= x <= 90)
ASIN: GTO 119 R/S (-1 <= x <= 1)
ACOS: GTO 137 R/S ( 0 <= x <= 1) (just a program limitation!)
ATAN: GTO 153 R/S (-9.99...E49 <= x <= 9.99...E49)