// Test Bracketmethod
System.out.println("Testing Bracketmethod");
Ran myran=new Ran(17);
Bracketmethod br = new Bracketmethod();
for (i=0;i<N;i++) {
a=50.0*myran.doub();
b=a+span;
br.bracket(a,b,this);
// System.out.printf(br.ax << " " << br.bx << " " << br.cx);
// System.out.printf(br.fa << " " << br.fb << " " << br.fc << endl);
localflag = localflag || (br.fa < br.fb) || (br.fc < br.fb);
}
globalflag = globalflag || localflag;
if (localflag) {
fail("*** Bracketmethod: Faulty bracket center value not the smallest");
}
double sbeps=3.e-16;
for (i=0;i<N;i++) {
a=50.0*myran.doub();
b=a+span;
br.bracket(a,b,this);
localflag = localflag || abs(br.fa - funk(br.ax))>sbeps
|| abs(br.fb - funk(br.bx))>sbeps
|| abs(br.fc - funk(br.cx))>sbeps;
}
globalflag = globalflag || localflag;