// integral of distribution is one
sbeps=1.e-10;
n=2.0;m=1.0;s=2.0;
func_Studenttdist dist = new func_Studenttdist(n,m,s);
Midinf q1 = new Midinf(dist,-1.0e99,-1.0);
Midpnt q2 = new Midpnt(dist,-1.0,1.0);
Midinf q3 = new Midinf(dist,1.0,1.0e99);
integral=qromo(q1)+qromo(q2)+qromo(q3);
localflag = abs(1.0-integral) > sbeps;
// System.out.printf(setprecision(15) << 1.0-integral);
globalflag = globalflag || localflag;
if (localflag) {
fail("*** Studenttdist: Distribution is not normalized to 1.0");
}
// cdf agrees with incomplete integral
sbeps=1.e-8;
n=2.0;m=0.5;s=1.5;
func_Studenttdist dist2 = new func_Studenttdist(n,m,s);
Studenttdist normcdf = new Studenttdist(n,m,s);
localflag=false;
for (i=0;i<N;i++) {
if (x[i] < 0.0) {
q1 = new Midinf(dist2,-1.e99,x[i]);
integral=qromo(q1);
} else {
q1 = new Midinf(dist2,-1.e99,-1.0);
q2 = new Midpnt(dist2,-1.0,x[i]);
integral=qromo(q1)+qromo(q2);
}
c[i]=integral;
d[i]=normcdf.cdf(x[i]);