Post Reply 
HP49-50G : tan(x) 50% faster than sin(x) or cos(x)
09-04-2022, 02:25 PM (This post was last modified: 09-04-2022 02:42 PM by J-F Garnier.)
Post: #13
RE: HP49-50G : tan(x) 50% faster than sin(x) or cos(x)
(09-03-2022 01:21 PM)Gil Wrote:  When executing loops for tan(x) on the emu48 with an android phone, we see that the average execution time for tan(x) on HP50G is 1.5 faster than for sin(x) or cos(x).

Shouldn't it be about the same speed (±10% instead of +50%)?

From the HP Saturn math source code (released HP-71B version):

** SINE, COSINE, & TANGENT
** [...] a pseudo divide produces (X,Y) with
** 0<=Y<=X and TAN(Phi) = Y/X. Formulas;
** TAN(Phi) = Y/X
** SIN(Phi) = 1/SQRT(1+(X/Y)^2)
** COS(Phi) = 1/SQRT(1+(Y/X)^2)



(09-03-2022 09:28 PM)Gil Wrote:  Other question on the same theme:
Why is ln(x) about 2.8 faster than sin(x), but log(x) only 2.1 faster than sin(x)?
This one is easier: because log(x) is calculated by log(x)=ln(x)/ln(10) i.e. one division more.

If you have an interest in the HP math algorithms, you can refer to the HP-71B IDS documents, where the source code is quite well commented (contrary to the HP-41 math in the VASM). The same algorithms were mainly unchanged in the next Saturn machines up to the series 48, 49 and 50, although the implementation may slightly varies.

Also you can refer to the historic article series about math algorithms in the HP Journals, for instance:
"Personal Calculator Algorithms IV: Logarithm Functions" in HP Journal, April 1978, p.29

J-F
(Eric beat me, apparently one of the few that have access to the series 48 source code :-)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP49-50G : tan(x) 50% faster than sin(x) or cos(x) - J-F Garnier - 09-04-2022 02:25 PM



User(s) browsing this thread: 1 Guest(s)