// Test Ratfn
System.out.println("Testing Ratfn: constructor #1");
Ratfn rp1 = new Ratfn(bb,cc);
for (i=0;i<M;i++) {
x=-4.5+i;
y[i]=rp1.get(x);
yy[i]=(3.0/2.0)*pow(x-1.0,2);
}
System.out.printf("Ratfn: Maximum discrepancy = %f\n", maxel(vecsub(y,yy)));
localflag = maxel(vecsub(y,yy)) > sbeps;
globalflag = globalflag || localflag;
if (localflag) {
fail("*** Ratfn: Rational function returns incorrect values");
}
System.out.println("Testing Ratfn: constructor #2");
Ratfn rp2= new Ratfn(dd,6,4);
for (i=0;i<M;i++) {
x=-4.5+i;
y[i]=rp2.get(x);
yy[i]=(3.0/2.0)*pow(x-1.0,2);
}
System.out.printf("Ratfn: Maximum discrepancy = %f\n", maxel(vecsub(y,yy)));
localflag = maxel(vecsub(y,yy)) > sbeps;
globalflag = globalflag || localflag;