quadraticApproximation

constexpr Complex quadraticApproximation(Complex (*f)(Complex), const Complex &z) noexcept

Evaluates the quadratic Taylor approximation of a complex function at a point \(z\) [1].

Parameters

Complex (*f)(Complex)

The function to approximate.

const Complex &z0

The complex point at which to center the approximation.

const Complex &z

The complex point at which to evaluate the approximation.

Returns

type Complex

A complex number.

This function simply returns the quadratic approximation of \(f\) evaluated at a point \(z\), that is:

\[f(z) \approx f(z_0) + f'(z_0)(z - z_0) + \frac{1}{2}f''(z_0)(z - z_0)^2\]

Example

auto fn = [](Complex z) { return sin(z); };
std::cout << quadraticApproximation(fn, 1 + 1_j, 1) << "\n";

Output:

0.958789 + 0.118717j

References