gamma

constexpr Complex gamma(const Complex &z) noexcept

Evaluates the gamma function [1] for a complex input. Uses the Lanczos approximation [2].

Parameters

const Complex &z

A complex number.

Returns

type Complex

A complex number.

The gamma function is an extrapolation of the factorial to complex and decimal inputs. It is defined as follows:

\[\Gamma(z) = \int_{0}^{\infty} t^{z - 1}e^{-t}dt\]

Example

Complex z = 1.0 + 1_j;
std::cout << gamma(z) << "\n";

Output:

0.498016 - 0.15495j

References