flintlib / arb

Arb has been merged into FLINT -- use https://github.com/flintlib/flint/ instead
http://arblib.org/
GNU Lesser General Public License v2.1
455 stars 137 forks source link

Numerical differentiation #271

Open fredrik-johansson opened 5 years ago

fredrik-johansson commented 5 years ago

There should be some functionality to compute the (multivariate) truncated Taylor series of a given (multivariate) complex analytic function.

Thoughts on this so far:

simonpuchert commented 3 years ago

At least for the univariate case, using equidistant nodes on a circle around the point seems to be (near-)optimal. In particular, for N ≥ n+1,

1/z^(n+1) ~ z^(N-n-1)/(z^N - r^N) = sum_w 1/(N * r^n * w^n * (z - r*w)) and thus f^(n) (x) ~ n! * sum_w 1/(N * r^n * w^n) * f(x + r*w), where sum_w is the sum over the N-th roots of unity.

The error (... - f^(n) (x)) is found as a contour integral over n! / (2πi) * r^N / (z^(n+1) * (z^N - r^N)) * f(z), so e.g. if f is bounded on the circle of radius R around x via |f| ≤ M, then |Error| ≤ n! M * r^N / (R^n (R^N - r^N))

This should work around most of the stability problems (the second bullet point in the previous post).

In theory, the above idea can be used for the multivariate case by a simple product construction, but the number of nodes increases very quickly and it's also suboptimal. This can be understood geometrically by mapping monomials to lattice points, e.g. x^3 y^5 z^2 to (3,5,2). The "exact" monomials from above form a cuboid, but a simplex would likely be better.