// by jcho #include #include "libmultifunc/libfunc.h" #include //used in Si func int factorial(int i) { int k, j; if (i<2){ return 1; } k=1; for(j=1;j= pi*6.2/4.0){ double out_sin = 0.0; double out_cos = 0.0; out = pi/2.0; for (i=0; i ITMAX) printf("a too large, ITMAX too small in gcf"); *gammcf = exp(-x+a*log(x)-(*gln))*h; return; } /** Represents incomplete error function, P(a,x) **/ float gammp(float a, float x) { float gamser,gammcf,gln; if(x < 0.0 || a <= 0.0) printf("Invalid arguments in routine gammp"); if (x < (a+1.0)) { gser(&gamser,a,x,&gln); return gamser; } else { gcf(&gammcf,a,x,&gln); return 1.0 - gammcf; } } /** Implementation of the error function, erf(x) **/ float erff(float x) { return x < 0.0 ? -gammp(0.5,x*x) : gammp(0.5,x*x); }