C language hacking

Mike Niswonger CNISWONGER at SIMTEL20.ARPA
Wed Nov 21 12:12:12 AEST 1984


Doug,
	I have run into the same situation as you in often needing both
sin and cos in doing coordinate transformations.  However, after looking
at the algorithims presently used, only a small amount of time could be
saved.
	Most commercial FORTRAN compilers use a 4 or 5 term Chebychev app-
roximation.  Unfortunately, odd powers are used for sine and even terms
are used for the cosine (or is it the other way around?? never could re-
member).  The only actual duplicated code would be where the input angle
is reduced ("unwrapped") to its reference angle.  On the machine that I
normally use, a Gould 32/8780, an SIN or a COS take about 7.5 uS, with
a SQRT taking about 8 uS.  These times are including the FORTRAN overhead.
	>>sigh!!<< With something that simple, I decided not to shave any
more - it wasn't worth the effort.		-- Mike
.

-------



More information about the Comp.lang.c mailing list