home *** CD-ROM | disk | FTP | other *** search
- /* auto6.c - float math library benchmark programs */
- #include "stdio.h"
- float a1[4] = { 0.1 , 0.5 , 1.1 , 3.1 } ;
- float a2[8] = { 2.0 , 5.2 , 16.0 , 111.1 ,
- 1000.0 , 0.1 , 0.01 , 0.001 } ;
- float y[4] ;
-
- double exp() , log() , sin() , tan() ;
-
-
- int explog()
- {
- int i ;
-
- for(i=0; i< 100 ; i++ )
- { y[i % 4] = exp( a1[i % 4] )
- + log( a2[i % 8] ) ;
- }
- }
-
-
- float b1[4] = { 0.1 , 0.7 , 1.4 , 2.9 } ;
- float b2[8] = { 0.1 , 0.7 , 1.4 , 2.9 ,
- - 0.1 , - 0.7 , - 1.4 , - 2.9 } ;
-
-
- int sintan()
- {
- int i ;
-
- for(i=0; i<100 ; i++ )
- { y[i % 4] = sin( b1[i % 4] )
- + tan( b2[i % 8 ] ) ;
- }
- }
-