08-14-2018, 09:21 PM

As the most of members here are aware, the first pocket scientific calculator on the world uses the following formulas to calculate sin and cos:

\[ \sin (x) = \frac{\tan (x)}{\sqrt{1+{\tan^2(x)}}} \]

\[ \cos (x) = \frac{\cot (x)}{\sqrt{1+{\cot^2(x)}}} \]

As tan function is calculated using CORDIC, from my point of view, a bit faster and easier formulas could be some of follows for a half angle, avoiding using sqrt:

\[ \sin (2x) = \frac{2 \cdot \tan (x)}{1+{{\tan^2(x)}}}\]

\[ \sin (2x) = \frac{2} {\frac{1}{\tan(x)} + \tan(x)} \]

\[ \cos (2x) = \frac{1-\tan^2 (x)}{1+ \tan^2(x)} \]

\[ \cos (2x) = 1 - \frac{2 \cdot \tan^2 (x)}{1+{{\tan^2(x)}}} \]

\[ \cos (2x) = \frac{2}{1+\tan^2(x)} - 1 \]

I doubt HP wasn't aware of it when designing HP-35. It is interesting, however, what is possible reason not to use them. One probably reason I can think of is symmetrical form in formulas with sqrt, which may save some valuable space. The second, probably may be accuracy, as last significant digit may be inaccurate in most of upper functions, without proper round off mechanism lack in HP-35 due limited space.

One day I will probably try to modify the firmware regarding upper and test speed and accuracy difference. The most problematic here is that early MOSTEK chip made for HP-35 missing better handling when switch ROM and many jump instructions make a nightmare to do even smallest change. I would probably use extended instructions for ROM switches, used in later MOSTEK chips.

And this perhaps may be as well an interesting challenge for other members here, familiar with early microcode.

\[ \sin (x) = \frac{\tan (x)}{\sqrt{1+{\tan^2(x)}}} \]

\[ \cos (x) = \frac{\cot (x)}{\sqrt{1+{\cot^2(x)}}} \]

As tan function is calculated using CORDIC, from my point of view, a bit faster and easier formulas could be some of follows for a half angle, avoiding using sqrt:

\[ \sin (2x) = \frac{2 \cdot \tan (x)}{1+{{\tan^2(x)}}}\]

\[ \sin (2x) = \frac{2} {\frac{1}{\tan(x)} + \tan(x)} \]

\[ \cos (2x) = \frac{1-\tan^2 (x)}{1+ \tan^2(x)} \]

\[ \cos (2x) = 1 - \frac{2 \cdot \tan^2 (x)}{1+{{\tan^2(x)}}} \]

\[ \cos (2x) = \frac{2}{1+\tan^2(x)} - 1 \]

I doubt HP wasn't aware of it when designing HP-35. It is interesting, however, what is possible reason not to use them. One probably reason I can think of is symmetrical form in formulas with sqrt, which may save some valuable space. The second, probably may be accuracy, as last significant digit may be inaccurate in most of upper functions, without proper round off mechanism lack in HP-35 due limited space.

One day I will probably try to modify the firmware regarding upper and test speed and accuracy difference. The most problematic here is that early MOSTEK chip made for HP-35 missing better handling when switch ROM and many jump instructions make a nightmare to do even smallest change. I would probably use extended instructions for ROM switches, used in later MOSTEK chips.

And this perhaps may be as well an interesting challenge for other members here, familiar with early microcode.