home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctech / 1988_02 / auto6.c < prev    next >
Text File  |  1985-09-30  |  665b  |  37 lines

  1. /* auto6.c - float math library benchmark programs */
  2. #include "stdio.h"
  3. float a1[4] = { 0.1 , 0.5 , 1.1 , 3.1 } ;
  4. float a2[8] = { 2.0 , 5.2 , 16.0 , 111.1 ,
  5.              1000.0 , 0.1 , 0.01 , 0.001 } ;
  6. float y[4] ;
  7.  
  8. double exp() , log() , sin() , tan() ;
  9.  
  10.  
  11. int explog()
  12.  {
  13.     int i ;
  14.  
  15.     for(i=0; i< 100 ; i++ )
  16.         { y[i % 4] = exp( a1[i % 4] )
  17.              + log( a2[i % 8] ) ;
  18.        }
  19.  }
  20.  
  21.  
  22. float b1[4] = { 0.1 , 0.7 , 1.4 , 2.9 } ;
  23. float b2[8] = { 0.1 , 0.7 , 1.4 , 2.9 ,
  24.               - 0.1 , - 0.7 , - 1.4 , - 2.9 } ;
  25.  
  26.  
  27. int sintan()
  28.  {
  29.     int i ;
  30.  
  31.     for(i=0; i<100 ; i++ )
  32.         { y[i % 4] = sin( b1[i % 4] ) 
  33.             + tan( b2[i % 8 ] ) ;
  34.         }
  35.  }
  36.  
  37.