/*llvm-gcc -O5 -emit-llvm -c -o pi_llvm.bc pi.c[anders@macbook Desktop]$ time lli -load=/usr/lib/libm.so pi_llvm.bc 800000000Pi = 3.1415926511real 0m22.930suser 0m22.912ssys 0m0.010s(gcc 4.2)gcc -O3 -mtune=native -o pi_gcc4 pi.c[anders@macbook Desktop]$ time ./pi_gcc4 800000000Pi = 3.1415926511real 0m27.328suser 0m27.318ssys 0m0.000s*//* Name: Pi Calculator Beta. Author: Sayan Chakraborti. Description: This program calculates the value of Pi. Date: Friday, May 31, 2002. Copyright: This program is distributed under the GNU General Public License. modified to use first arg on cmd line instead of input*/#include<stdio.h>#include<math.h>int main(int argc, char *argv[]){ double r=0, x=1, y=0, s=0, a=0, p=0; //printf("\n\n***************************************************************\n\n"); //printf("Give radius much much greater than 1\nRadius = "); //scanf("%lf",&r); sscanf(argv[1], "%lf", &r); while(x<=r) { y=sqrt(r*r- x*x); s=s+y; x=x+1; } a=(s*4); p=a/(r*r); printf("Pi = %1.10lf\n",p); //printf("\n\n***************************************************************\n\n"); // getchar(); return 0;}