C language hacking
John Woods
john at x.UUCP
Sat Nov 17 02:12:42 AEST 1984
>
> "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 at MIT-XX.ARPA
If your puppy goes off in the next room,
is it because of the explosive charge? [y][n]
More information about the Comp.lang.c
mailing list