Fortran computes cosine 300 times faster than C (on Sun3)
Clarence Dold
cdold at starfish.Convergent.COM
Tue Mar 14 05:28:01 AEST 1989
>From article <688 at friday.UUCP>, by fritz at friday.UUCP (Fritz Whittington):
>>I chanced upon a segment of code that runs approximately 300 times faster in
>>FORTRAN than in C. I have tried the code on Sun3(OS3.5) and on Sun4(OS4.0)
. . .
>> for(i=0;i<262144;i++)
>> tmp=cos(2.5)*cos(2.5)*cos(2.5)*cos(2.5);
. . .
What about a Floating Point Chip?
Is Fortran configured to use the FPU by default, while the C compiler
uses software floating point?
--
Clarence A Dold - cdold at starfish.Convergent.COM (408) 434-2083
...pyramid!ctnews!starfish!cdold
P.O.Box 6685, San Jose, CA 95150-6685
More information about the Comp.lang.c
mailing list