public double rawinterp(final int jl, final double x) {
    final double TINY=1.0e-99;
    int m,i,ns=0;
    double y,w,t,hh,h,dd;
    // const double *xa = &xx[jl], *ya = &yy[jl];
    double[] c = new double[mm];
    double[] d = new double[mm];
    hh=abs(x-xx[jl+0]);
    for (i=0;i<mm;i++) {
      h=abs(x-xx[jl+i]);
      if (h == 0.0) {
        dy=0.0;
        return yy[jl+i];
      } else if (h < hh) {
        ns=i;
        hh=h;
      }
      c[i]=yy[jl+i];
      d[i]=yy[jl+i]+TINY;
    }
    y=yy[jl+ns--];
    for (m=1;m<mm;m++) {
      for (i=0;i<mm-m;i++) {
        w=c[i+1]-d[i];
        h=xx[jl+i+m]-x;
        t=(xx[jl+i]-x)*d[i]/h;
        dd=t-c[i+1];
        if (dd == 0.0) throw new IllegalArgumentException("Error in routine ratint");
        dd=w/dd;
        d[i]=c[i+1]*dd;
        c[i]=t*dd;
      }
      y += (dy=(2*(ns+1) < (mm-m) ? c[ns+1] : d[ns--]));
    }
    return y;
  }