Class Dfdx

  • All Implemented Interfaces:
    Function<Vector,​Double>, RealScalarFunction, UnivariateRealFunction

    public class Dfdx
    extends AbstractUnivariateRealFunction
    The first derivative is a measure of how a function changes as its input changes. In other words, a derivative is how much a quantity changes if the input changes (by a very small amount). The derivative of a function at a particular point is the best linear approximation of the function at that point. For a univariate real function, the derivative at a point is the slope of the tangent line to the function at that point.

    This implementation is a simple wrapper class around the built-in derivative functions, e.g., DBeta, DErf, and the numerical derivative computation classes, e.g., FiniteDifference and Ridders.

    See Also:
    Wikipedia: Derivative, FiniteDifference
    • Constructor Detail

      • Dfdx

        public Dfdx​(UnivariateRealFunction f,
                    Dfdx.Method method)
        Construct the first order derivative function of a univariate function f.
        Parameters:
        f - a univariate function
        method - the numerical method to use, c.f., Dfdx.Method
      • Dfdx

        public Dfdx​(UnivariateRealFunction f)
        Construct, using the central finite difference, the first order derivative function of a univariate function f.
        Parameters:
        f - a univariate function
    • Method Detail

      • evaluate

        public double evaluate​(double x)
        Description copied from interface: UnivariateRealFunction
        Evaluate y = f(x).
        Parameters:
        x - x
        Returns:
        f(x)