X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=fisher2.c;h=c86183459dcacebb606125fa12bea3ea08d41918;hb=8dd3c225255d7084e3aff8740aa4f1f1cabb367a;hp=35f0b4d9cbcf5ed74568e5271a72f3eb4aae4a21;hpb=7bf581f8c46b08eb3bb40715dac94695edee4a67;p=mothur.git diff --git a/fisher2.c b/fisher2.c index 35f0b4d..c861834 100644 --- a/fisher2.c +++ b/fisher2.c @@ -41,8 +41,6 @@ static int iwork(int iwkmax, int *iwkpt, int number, int itype); static double alogam(double *x, int *ifault); - - /* The only public function : */ void fexact(int *nrow, int *ncol, double *table, int *ldtabl, double *expect, double *percnt, double *emin, double *prt, @@ -319,7 +317,7 @@ f2xact(int *nrow, int *ncol, double *table, int *ldtabl, /* AMISS is a missing value indicator which is returned when the probability is not defined. */ const double amiss = -12345.; - + /* TOL is chosen as the square root of the smallest relative spacing. */ #ifndef Macintosh const static double tol = 3.45254e-7; @@ -2117,7 +2115,7 @@ L10: double alogam(double *x, int *ifault) { /* Initialized data */ - + //printf("alogam x = %f\t%d\n",*x,*ifault); static double a1 = .918938533204673; static double a2 = 5.95238095238e-4; static double a3 = 7.93650793651e-4; @@ -2149,6 +2147,8 @@ L20: f = -log(f); L30: z = 1. / (y * y); + + //printf("returning %f\n",(f + (y - .5) * log(y) - y + a1 + (((-a2 * z + a3) * z - a4) * z + a5) / y)); return(f + (y - .5) * log(y) - y + a1 + (((-a2 * z + a3) * z - a4) * z + a5) / y); }