/* / Author: Haytham Alsaghayer / Class: MA 5903 / Date: July 23, 2009 / Assignment: CORDIC */ #include "Header.h" int main(int argc, char *argv[]) { float x, sinCORDIC; printf("x-value CORDIC Maclaurin c-library Duration for CORDIC\n"); //get input while (scanf("%f", &x) != EOF) { // start timer struct timeval tim; gettimeofday(&tim, NULL); double t1=tim.tv_sec+(tim.tv_usec/MILLISECOND); //vec = cordic(x, 23); sinCORDIC = cordicSin(x); // end timer gettimeofday(&tim, NULL); double t2=tim.tv_sec+(tim.tv_usec/MILLISECOND); printf("%-15g%-15g%-15g%-15g%g seconds\n", x, sinCORDIC, maclaurinPoly(x), sin(x), (t2-t1)); } return 0; }