ForwardDiff.derivative(xvar -> 2.0 * (xvar - 1)^2, x[1])
This formulation might make it even cleaner that you’re taking the derivative of the function f(xvar) applied at xvar = x[1]
ForwardDiff.derivative(xvar -> 2.0 * (xvar - 1)^2, x[1])
This formulation might make it even cleaner that you’re taking the derivative of the function f(xvar) applied at xvar = x[1]