VEGAS vegas = new VEGAS() {
public double fxn(final double[] x, final double wgt){
return torusfunc1(x, wgt);
}
};
vegas.vegas(regn,0,1000,100,-1,tgral,sd,chi2a);
// System.out.printf(chi2a);
localflag = chi2a.val > 1.2;
globalflag = globalflag || localflag;
if (localflag) {
fail("*** vegas: chi-square for test #1 is too high");