Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!internet!Mike Niswonger From: Mike Niswonger Newsgroups: net.lang.c Subject: Re: C language hacking Message-ID: <5974@brl-tgr.ARPA> Date: Tue, 20-Nov-84 21:12:12 EST Article-I.D.: brl-tgr.5974 Posted: Tue Nov 20 21:12:12 1984 Date-Received: Thu, 22-Nov-84 06:01:08 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 17 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 . -------