/* Other functions that maybe useful
* rduarte@ciencias.unam.mx
*/
#include "complex.h"
/* This sucks a little...
* but is useful if you want to calculate a
* fast cosine a millions of times.. error is bounded between
* 1/10^3 to 1/10^2 to get cos(PI/2 * Theta)
*/
double aprox_cos(float x) {
x = x/(M_PI/2);
return 1-(x*x) / ((x+(1-x))*sqrt( (2-x)/3 )) ;
}