HP12c software: Sine and Cosine approximations


As an engineer I should really only be using the HP15c but sometimes I use as well a HP12c. The HP12c has no trigonometric functions. It is however possible to use the following approximations and write a short hp12c program.

sin approximation

sin(x) = x * ( 1 + x2 * (0.00761 * x2 - 0.16605))

x must be between 0 and π/2

Error of the approximation: 2 * 10-4 for 0 <= x <= pi/2

cos approximation

cos(x) =  1 + x2 * (0.03705 * x2 - 0.49670))

x must be between 0 and π/2

Error of the approximation: 2 * 10-9 for 0 <= x <= pi/2

It is as well possible to use this formula: 
cos(x) = sqrt(1 - sin(x)2) for 0 <= x <= pi/2

tan

tan(x) = sin(x)/cos(x) = sin(x)/(sqrt(1 - sin(x)2))

A sin(x) program

command      display

f PRGM        00-   (to delete any existing program)
   STO 9       01-   44 9
   Enter       02-     36
   *           03-     20
   .           04-     48
   0           05-      0
   0           06-      0
   7           07-      7
   6           08-      6
   1           09-      1
   *           10-     20
   .           11-     48
   1           12-      1
   6           13-      6
   6           14-      6
   0           15-      0
   -           17-     30
   RCL 9       18-   45 9
   *           19-     20
   RCL 9       20-   45 9
   *           21-     20
   1           22-      1
   +           23-     40
   RCL 9       24-   45 9
   *           25-     20

now press f P/R to leave
the programming mode

This program uses the following register: STO 9

Using the program

Just enter the angle in RAD (fractions of π=3.14159) and then press R/S.

Example for x = 45°= 3.14159/4: To calculate sin(x) type R/S and the result should be 0.7072

References


© Guido Socher