1 /*
2  *========================================================================
3  * $Id: Xtest.c 239 2006-10-03 18:56:47Z rgb $
4  *
5  * See copyright in copyright.h and the accompanying file COPYING
6  *========================================================================
7  */
8 
9 /*
10  *========================================================================
11  * This should be a nice, big case switch where we add EACH test
12  * we might want to do and either just configure and do it or
13  * prompt for input (if absolutely necessary) and then do it.
14  *========================================================================
15  */
16 
17 #include <dieharder/libdieharder.h>
18 
Xtest_eval(Xtest * xtest)19 void Xtest_eval(Xtest *xtest)
20 {
21 
22  /*
23   * This routine evaluates the p-value from the xtest data.
24   * x, y, sigma all must be filled in by the calling routine.
25   */
26 /*
27 xtest->pvalue =
28       0.5*gsl_sf_erfc((xtest->y - xtest->x)/(sqrt(2.0)*xtest->sigma));
29 xtest->pvalue =
30       1 - 0.5*gsl_sf_erfc((xtest->y - xtest->x)/(sqrt(2.0)*xtest->sigma));
31 xtest->pvalue =
32       gsl_sf_erfc(fabs(xtest->y - xtest->x)/(sqrt(2.0)*xtest->sigma));
33 */
34 xtest->pvalue =
35       gsl_cdf_gaussian_P(xtest->y - xtest->x,xtest->sigma);
36 
37  if(verbose == D_XTEST || verbose == D_ALL){
38    printf("# Xtest_eval(): x = %10.5f  y = %10.5f  sigma = %10.5f\n",
39      xtest->x, xtest->y, xtest->sigma);
40    printf("# Xtest_eval(): p-value = %10.5f\n",xtest->pvalue);
41  }
42 
43 }
44 
45