General Toolkit - cauchy


Function File: cauchy (N, r, x, f )

Return the Taylor coefficients and numerical differentiation of a function.

f for the first N-1 coefficients or derivatives using the fft.
N is the number of points to evaluate,
r is the radius of convergence, needs to be chosen less then the smallest singularity,
x is point to evaluate the Taylor expansion or differentiation. For example,

If x is a scalar, the function f is evaluated in a row vector of length N. If x is a column vector, f is evaluated in a matrix of length(x)-by-N elements and must return a matrix of the same size.

 
 d = cauchy(16, 1.5, 0, @(x) exp(x));
 d(2) = 1.0000 # first (2-1) derivative of function f (index starts from zero)