Hacker News new | past | comments | ask | show | jobs | submit login

I DO think Python libraries can do this already.



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.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


Did not intend to make any claims that Python libraries don't do this, but rather to explore the subject as a way to better understand the implementation and limits of floating point numbers and numerical analysis based on them.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: