/src/main/java/net/finmath/interpolation/RationalFunctionInterpolation.java
final double[] slope = new double[numberOfPoints-1];final double[] derivative = new double[numberOfPoints];
final double[] derivative = new double[numberOfPoints];
step[i] = (points[i+1] - points[i]); slope[i] = (values[i+1] - values[i]) / step[i]; if(i > 0){ doubleStep[i-1] = points[i+1] - points[i-1]; } } <extra_id_0> derivative[0] =(2*step[0] + step[1])/doubleStep[0] * slope[0] - step[0]/doubleStep[0] * slope[1]; derivative[numberOfPoints-1] =(2*step[numberOfPoints-2] + step[numberOfPoints-3])/doubleStep[numberOfPoints-3] * slope[numberOfPoints-2] - step[numberOfPoints-2]/doubleStep[numberOfPoints-3] * slope[numberOfPoints-3]; if(interpolationMethod == InterpolationMethod.HARMONIC_SPLINE_WITH_MONOTONIC_FILTERING){ if((derivative[0]*slope[0] > 0) && (slope[0]*slope[1] <= 0) && (Math.abs(derivative[0]) < 3*Math.abs(slope[0]))) { derivative[0] = 3 * slope[0];