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!genrad!wjh12!talcott!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: C language hacking Message-ID: <5823@brl-tgr.ARPA> Date: Fri, 16-Nov-84 08:55:00 EST Article-I.D.: brl-tgr.5823 Posted: Fri Nov 16 08:55:00 1984 Date-Received: Sat, 17-Nov-84 05:49:46 EST References: <5715@brl-tgr.ARPA> <1161@orca.UUCP> Organization: Ballistic Research Lab Lines: 15 >> It would also be nice if sin( x ) and cos( x ) could be >> computed simultaneously with reduced cost. I doubt if this is >> possible but would like to know if it is. > sine = sin(x); > cosine = sqrt(1.0 - sine*sine); I wish people would check things out before posting them. On our 4.2BSD system, the sqrt() approach is actually SLOWER than using cos(). (Under UNIX System V it is very slightly faster.) Now, if I wanted cos(x)^2, I would certainly use 1 - sin(x)^2, which I already knew about (I too went to high school). What I had in mind was more along the lines of a CORDIC algorithm or some other obscure but useful approach.