HP-35 style trig functions
|
01-15-2019, 07:10 AM
Post: #10
|
|||
|
|||
RE: HP-35 style trig functions
(01-15-2019 03:43 AM)Dan Wrote: "The preceding approach could be reworked using powers of 1/10 instead of powers of 1/2; it is only necessary (as was done for the hyperbolic examples) to work with lists that contain many duplicate entries". You only have to add an additional loop in the cordic function and adjust K: Code: from math import sqrt, sin, cos, atan This results in: arg = 0.4 cordic(1/K, 0, arg, 1.0, ATAN) (0.9210609940028851, 0.38941834230865136, -2.986136694229353e-16) Compare this to: >>> cos(arg), sin(arg) (0.9210609940028851, 0.3894183423086505) The cost is a possible unnecessary flipping between two states. But you can avoid the calculation of the square root. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
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 - Thomas Klemm - 01-13-2019, 10:58 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 - Thomas Klemm - 01-14-2019, 08:57 AM
RE: HP-35 style trig functions - Thomas Klemm - 01-15-2019 07:10 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
RE: HP-35 style trig functions - Thomas Klemm - 08-29-2023, 05:39 AM
|
User(s) browsing this thread: 1 Guest(s)