for (i=0;i<N;i++) {
x[i]=(double)(i)/(N-1);
y[i]=(1.0-x[i]*(0.5-0.1*x[i]))/(1.0+(x[i]-2.0)*(x[i]-2.0));
}
Ran myran = new Ran(17);
Rational_interp z = new Rational_interp(x,y,3);
for (i=0;i<N;i++) {
xx[i]=myran.doub();
yy[i]=z.interp(xx[i]); // interpolated values
dyy[i]=z.dy; // Estimated error
zz[i]=(1.0-xx[i]*(0.5-0.1*xx[i]))/(1.0+(xx[i]-2.0)*(xx[i]-2.0)); // Actual values
}
System.out.printf(" Rat_interp: Max. estimated error: %f\n", maxel(dyy));
System.out.printf(" Rat_interp: Max. actual error: %f\n", maxel(vecsub(zz,yy)));