num_dual.gradient

num_dual.gradient(f, x)

Calculate the gradient of a scalar, multivariate function.

Parameters

fcallable

A scalar, multivariate function.

x[float]

The vector for which the gradient is evaluated.

Returns

function value and gradient