pi

constexpr Complex pi(const Complex &z) noexcept

Evaluates the pi function [1] for a complex input.

Parameters

const Complex &z

A complex number.

Returns

type Complex

A complex number.

The pi function is another extrapolation of the factorial function, closely related to the gamma function. It is defined as follows:

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

The pi function may be written in terms of the gamma function as follows:

\[\Pi(z) = \Gamma(z + 1)\]

Example

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

Output:

0.652965 + 0.343066j

References