DoubleFunction1D extends Function1D<Double, Double> { public DoubleFunction1D subtract(final DoubleFunction1D f) { Validate.notNull(f, "f"); return new DoubleFunction1D() { @Override public Double evaluate(final Double x) { return DoubleFunction1D.this.evaluate(x) - f.evaluate(x); } }; }  DoubleFunction1D derivative(); DoubleFunction1D derivative(final FiniteDifferenceType differenceType, final double eps); DoubleFunction1D add(final DoubleFunction1D f); DoubleFunction1D add(final double a); DoubleFunction1D divide(final DoubleFunction1D f); DoubleFunction1D divide(final double a); DoubleFunction1D multiply(final DoubleFunction1D f); DoubleFunction1D multiply(final double a); DoubleFunction1D subtract(final DoubleFunction1D f); DoubleFunction1D subtract(final double a); static DoubleFunction1D from(final Function1D<Double, Double> f);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSubtractNull() { F1.subtract(null); }
@Test public void testSubtract() { assertEquals(F1.subtract(F2).evaluate(X), F1.evaluate(X) - F2.evaluate(X), EPS); assertEquals(F1.subtract(A).evaluate(X), F1.evaluate(X) - A, EPS); }