Post Reply 
HP-35 style trig functions
01-14-2019, 05:32 AM
Post: #7
RE: HP-35 style trig functions
(01-14-2019 02:34 AM)Druzyek Wrote:  Using the method I posted above with divides by 10 only takes 60k-80k cycles! Calculating sine and cosine from that might take 2-4 times longer with the square root and multiplies, which is still very fast, but it would be nice to know how to do it without that (I'm starting to think it is not possible).

Using powers of 10 you can't tell a priori how often you have to rotate by the angle \(\arctan 10^{-k}\).
The problem is that each rotation is also a dilation by the factor \(\sqrt{1+10^{-2k}}\).
And somehow you have to take that into account.

You could keep these values calculated in a table but you'd still have to multiply them to get the final radius.
I'd estimate that the average amount of multiplications are about 5 times the number of digits.

Otherwise you end up with \(x=r \cos \phi\) and \(y=r \sin \phi\) for an unknown radius \(r\).
Now you can either calculate \(\tan \phi = \frac{y}{x}\) or calculate the radius \(r=\sqrt{x^2+y^2}\) and then from this get \(\cos \phi = \frac{x}{r}\) and \(\sin \phi = \frac{y}{r}\).
This means two multiplication, one square root and two divisions.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-35 style trig functions - Druzyek - 01-13-2019, 08:32 PM
RE: HP-35 style trig functions - pier4r - 01-13-2019, 08:37 PM
RE: HP-35 style trig functions - Druzyek - 01-14-2019, 12:56 AM
RE: HP-35 style trig functions - Dan - 01-14-2019, 01:31 AM
RE: HP-35 style trig functions - Druzyek - 01-14-2019, 02:34 AM
RE: HP-35 style trig functions - Dan - 01-15-2019, 03:43 AM
RE: HP-35 style trig functions - Thomas Klemm - 01-14-2019 05:32 AM
RE: HP-35 style trig functions - Druzyek - 01-15-2019, 11:49 PM
RE: HP-35 style trig functions - Druzyek - 08-28-2023, 12:19 AM



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