modified: myjupyterlab.sh
[GalaxyCodeBases.git] / BGI / SOAPsnp / normal_dis.cc
blob2ac0d8dcdb5a2c9da9b592868500fe46cf890d42
1 #include "soap_snp.h"
3 double Call_win::normal_value(double z) {
4 if (z>6.0 || z<-6.0) {
5 return 0.0;
7 else {
8 double b1 = 0.31938153;
9 double b2 = -0.356563782;
10 double b3 = 1.781477937;
11 double b4 = -1.821255978;
12 double b5 = 1.330274429;
13 double p = 0.2316419;
14 double c2 = 0.39894228;
16 double a = fabs(z);
17 double t = 1.0/(1.0+a*p);
18 double b = c2*exp((-z)*(z/2.0));
19 double n = ((((b5*t+b4)*t+b3)*t+b2)*t+b1)*t;
20 n = 1.0 - b*n;
21 if (z < 0.0) n = 1.0 - n;
22 return n>0.5?1-n:n;