//#include /* Sahu : Incsease SIZE to increase Execution time : Power of SMALLSIZE*/ /*This Program can run upto maxsize 256, Beause of the reverse() written in that way */ #define SIZE 256 #define SMALLSIZE 8 /*it can be any number*/ #define PI 3.14159265358979323846 double fabs(double x) { return x < 0 ? -x : x; } double sin(double rad) { double app, diff; int inc = 1; while( rad > 2*PI ) rad -= 2*PI; while( rad < -2*PI ) rad += 2*PI; app = diff = rad; diff = (diff * (-(rad*rad))) / ((2.0 * inc) * (2.0 * inc + 1.0)); app = app + diff; inc++; while( fabs(diff) >= 0.00001 ) { diff = (diff * (-(rad*rad))) / ((2.0 * inc) * (2.0 * inc + 1.0)); app = app + diff; inc++; } return app; } double cos(double rad) { double app,diff; int inc = 1; rad += PI/2.0; while( rad > 2*PI ) rad -= 2*PI; while( rad < -2*PI ) rad += 2*PI; app = diff = rad; diff = (diff * (-(rad*rad))) / ((2.0 * inc) * (2.0 * inc + 1.0)); app = app + diff; inc++; while( fabs(diff) >= 0.00001 ) { diff = (diff * (-(rad*rad))) / ((2.0 * inc) * (2.0 * inc + 1.0)); app = app + diff; inc++; } return app; } typedef struct complex { float r,i; /* Real and imaginery parts */ } COMPLEX; COMPLEX TF[SIZE]; COMPLEX input[SIZE]; int new_index[SIZE]; int reverse(int input, int n) { int output=0; int i; int ip=input; for(i=0;iSMALLSIZE) break; for (k=0; k