### Question:
ExponentialCurveExtrapolator implements CurveExtrapolator, Serializable { @Override public BoundCurveExtrapolator bind(DoubleArray xValues, DoubleArray yValues, BoundCurveInterpolator interpolator) { return new Bound(xValues, yValues, interpolator); } private  ExponentialCurveExtrapolator(); @Override String getName(); @Override BoundCurveExtrapolator bind(DoubleArray xValues, DoubleArray yValues, BoundCurveInterpolator interpolator); @Override String toString(); static final String NAME; static final CurveExtrapolator INSTANCE; }### Answer:
@Test public void value() { BoundCurveInterpolator bci = CurveInterpolators.LINEAR.bind(X_DATA, Y_DATA, EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); double mLeft = Math.log(Y_DATA.get(0)) / X_DATA.get(0); double mRight = Math.log(Y_DATA.get(X_DATA.size() - 1)) / X_DATA.get(X_DATA.size() - 1); assertThat(bci.interpolate(0.0)).isCloseTo(1d, offset(TOLERANCE_VALUE)); assertThat(bci.interpolate(-0.2)).isCloseTo(Math.exp(mLeft * -0.2), offset(TOLERANCE_VALUE)); assertThat(bci.interpolate(6.0)).isCloseTo(Math.exp(mRight * 6.0), offset(TOLERANCE_VALUE)); }
@Test public void sensitivity1() { BoundCurveInterpolator bci = CurveInterpolators.LINEAR.bind(X_DATA, Y_DATA, EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); double shift = 1e-8; double value = 0d; double[] yDataShifted = Y_DATA.toArray(); yDataShifted[0] += shift; BoundCurveInterpolator bciShifted1 = CurveInterpolators.LINEAR.bind(X_DATA, DoubleArray.ofUnsafe(yDataShifted), EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); assertThat(bci.parameterSensitivity(value).get(0)) .isCloseTo((bciShifted1.interpolate(value) - bci.interpolate(value)) / shift, offset(TOLERANCE_SENSI)); }
@Test public void sensitivity2() { BoundCurveInterpolator bci = CurveInterpolators.LINEAR.bind(X_DATA, Y_DATA, EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); double shift = 1e-8; double value = -0.2; double[] yDataShifted = Y_DATA.toArray(); yDataShifted[0] += shift; BoundCurveInterpolator bciShifted = CurveInterpolators.LINEAR.bind(X_DATA, DoubleArray.ofUnsafe(yDataShifted), EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); assertThat(bci.parameterSensitivity(value).get(0)) .isCloseTo((bciShifted.interpolate(value) - bci.interpolate(value)) / shift, offset(TOLERANCE_SENSI)); }
@Test public void sensitivity3() { BoundCurveInterpolator bci = CurveInterpolators.LINEAR.bind(X_DATA, Y_DATA, EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); double shift = 1e-8; double value = 6d; double[] yDataShifted = Y_DATA.toArray(); yDataShifted[Y_DATA.size() - 1] += shift; BoundCurveInterpolator bciShifted = CurveInterpolators.LINEAR.bind(X_DATA, DoubleArray.ofUnsafe(yDataShifted), EXP_EXTRAPOLATOR, EXP_EXTRAPOLATOR); assertThat(bci.parameterSensitivity(value).get(Y_DATA.size() - 1)) .isCloseTo((bciShifted.interpolate(value) - bci.interpolate(value)) / shift, offset(TOLERANCE_SENSI)); }