Enter RPN

All Files in rlm-12cp/barbosa-trig/
Login

All Files in rlm-12cp/barbosa-trig/

Files in directory rlm-12cp/barbosa-trig in any check-in


Description

Gerson W. Barbosa’s “Fast & Accurate Trigonometric Functions” for the HP-12c Platinum.

Usage

As shipped, the program is set to run in degrees mode. To switch it to radians, say g GTO 272 R/S.

To switch back to degrees, say g GTO 270 R/S.

To compute the value of a trig function, put the operand into X, then:

Fn Command
SIN R/S (implicit g GTO 000)
COS g GTO 090 R/S
TAN g GTO 100 R/S
ASIN g GTO 137 R/S
ACOS g GTO 157 R/S
ATAN g GTO 177 R/S

The result will be in X, but read on...

Resources

Compatibility

I transcribed this from the forum post using the RLM 12c Platinum simulator, then saved it out to the file above. Loading it will overwrite program steps 001-375 plus registers 0 thru 9 and .0 thru .9, which this simulator calls R10-19. I modified the simulator’s output to make it leave R20 onward untouched. It will not change the stack, the finance registers, or the calculator settings.

This simulator’s program dump format does not include a pretty-printed version, but you can get that from the source.

I offer this version for the convenience of those who do not wish to type all that in, or at least have a desire to try this out on a test platform before putting wear on their calculator keys and dedicating nearly their entire storage to this one program.

This program is too big to work on a regular 12C2 at about 4× the program space HP saw fit to provide in 1981. Plus, it uses functions added to the Platinum, the main one being . To get that on a regular 12C, you had to say 2, costing you one additional instruction per, for a total of seven in this program.

See Also

This effort is partially in support of my “Ballpark Accuracy” article.


  1. ^ You can save program space by running this subroutine once, then deleting from that line to the end of the program, and henceforth relying on the calculator (and your own caution) to preserve these ten registers. Or, you can type the constants in directly from the linked forum post and store them.
  2. ^ ...but you can resort to Valentin Albillo’s Tried & Tricky Trigonometrics, which takes a different approach to achieve its smaller size. To the same end, its calling interface also leaves much to be desired.