Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site x.UUCP Path: utzoo!linus!decvax!genrad!mit-eddie!cybvax0!frog!x!john From: john@x.UUCP (John Woods) Newsgroups: net.lang.c Subject: Re: C language hacking Message-ID: <383@x.UUCP> Date: Fri, 16-Nov-84 11:12:42 EST Article-I.D.: x.383 Posted: Fri Nov 16 11:12:42 1984 Date-Received: Tue, 20-Nov-84 07:22:29 EST References: <5715@brl-tgr.ARPA> <1161@orca.UUCP> Organization: Charles River Data Systems, Framingham MA Lines: 23 > > "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." > On a more serious note than my last message, how about: circular( value, sinptr, cosptr) double value, *sinptr, *cosptr; { /* compute both and store, saving function overhead and sharing some commonality of code */ } It's easy. Buggering the compiler to do it solves *one* case fast, at the expense of still having garbage code. Reminds me of compiler writers who detect the famous FORTRAN "Whetstone" benchmark and output hand-written assembly code for the whole thing, so as to achieve artificially high scores.. -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1114 ...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc@MIT-XX.ARPA If your puppy goes off in the next room, is it because of the explosive charge? [y][n]