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

Yay for functions which are analytic in some neighborhood. Here’s the original paper from the 60s about the idea in this post: http://www.math.fsu.edu/~okhanmoh/media/Lyness,%20Moler,%20S...

The latest work on this general topic is http://arxiv.org/pdf/1404.2463.pdf which manages to compute extremely accurate high-order derivatives (“...even the 100th derivative of an analytic function can be computed with near machine precision accuracy using standard floating point arithmetic”!!!), see also http://www.chebfun.org/examples/cheb/Turbo.html

* * *

Anyhow, for folks trying to take derivatives of (or do various other operations to) arbitrary continuous functions, I recommend checking out Chebfun – http://www.chebfun.org – a Matlab library created by a group of applied mathematicians at Oxford.

Instead of just looking at a couple points near some point of interest, Chebfun approximates the continuous function over some interval to near machine precision by a high-degree polynomial, and then operates on that polynomial.

Operations like numerical differentiation are much more accurate when you make the right “global” (i.e. not just at one single point) approximation.

Also check out Nick Trefethen’s book Approximation Theory and Approximation Practice, the first 6 chapters of which are available online: http://www.chebfun.org/ATAP/atap-first6chapters.pdf




The paper by Lyness and Moler is nice, but if it's really "about the idea in this post" then the fact is somewhat hidden. It's mostly about using the Cauchy integral formula to turn derivatives into integrals, using the Poisson summation formula to relate those to finite sums, and using the Moebius inversion formula to get those relations into a form from which you can extract the derivatives.

Maybe taking a very short partial sum of one of the series in Theorem 2 gives you the result in the blog post here, but that seems rather sledgehammer-to-crack-a-nut-ish when (as the blog post says) all you need is the Cauchy-Riemann equations.

I think it's true that the Lyness-Moler idea of "numerical differentiation by numerical complex integration" was, historically, part of the chain of ideas that led to the very simple "complex-step approximation" discussed in the blog post. But that's a far cry from saying that their paper is "about the idea in this post"!

There's some discussion of the history here: http://blogs.mathworks.com/cleve/2013/10/14/complex-step-dif... where Moler (as in "Lyness and Moler") says "The complex step algorithm that I'm about to describe is much simpler than anything described in that 1967 paper. So, although we have some claim of precedence for the idea of using complex arithmetic on real functions, we certainly cannot claim to have invented today's algorithm."

And yes, Chebfun is very nice.


Fair enough. :-)




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

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

Search: