3 ms·
The scipy.misc.derivative() function uses a central difference formula, rather than exploiting the fact that a function is analytic: https://docs.scipy.org/doc/
by jamessb 11y ago
The scipy.misc.derivative() function uses a central difference formula, rather than exploiting the fact that a function is analytic: https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.derivative.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.m...
Applying the Cauchy–Riemann equations to essentially take finite differences in the imaginary direction is an interesting trick I hadn't seen before, so I appreciated an article introducing it.
Edit: A separate python package, Numdifftools, does seem to support complex-step differentiation https://pypi.python.org/pypi/Numdifftools https://pypi.python.org/pypi/Numdifftools