* @return
*/
public static double qromb(final UniVarRealValueFun func, final double a, final double b, final double eps) {
final int JMAX=20, JMAXP=JMAX+1, K=5;
double[] s = new double[JMAX],h = new double[JMAXP];
Poly_interp polint = new Poly_interp(h,s,K);
h[0]=1.0;
Trapzd t = new Trapzd(func,a,b);
for (int j=1;j<=JMAX;j++) {
s[j-1]=t.next();
if (j >= K) {
double ss=polint.rawinterp(j-K,0.0);
if (abs(polint.dy) <= eps*abs(ss)) return ss;
}
h[j]=0.25*h[j-1];
}
throw new IllegalArgumentException("Too many steps in routine qromb");