class BarycentricRationalFunctionInterpolator1D extends Interpolator1D {

  @Override
  public Double interpolate(final Interpolator1DDataBundle data, final Double value) {
    Validate.notNull(value, "value");
    Validate.notNull(data, "data bundle");
    if (data.size() < _degree) {
      throw new MathException("Cannot interpolate " + data.size() + " data points with rational functions of degree " + _degree);
    }
    final int m = data.size();
    final double[] x = data.getKeys();
    final double[] y = data.getValues();
    if (data.getLowerBoundIndex(value) == m - 1) {
      return y[m - 1];
    }
    final double[] w = getWeights(x);
    final int n = x.length;
    double delta, temp, num = 0, den = 0;
    for (int i = 0; i < n; i++) {
      delta = value - x[i];
      if (Math.abs(delta) < _eps) {
        return y[i];
      }
      temp = w[i] / delta;
      num += temp * y[i];
      den += temp;
    }
    return num / den;
  }

  public  BarycentricRationalFunctionInterpolator1D(final int degree, double eps);

}