erf

inline Complex erf(const Complex &z) noexcept

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

Parameters

const Complex &z

A complex number.

Returns

type Complex

A complex number.

The erf, or error function, is a scaled, nonelementary integral commonly used in probability and statistics. It is defined as:

\[\DeclareMathOperator\erf{erf} \erf(z) = \frac{2}{\sqrt{\pi}} \int_{0}^{z}e^{-t^2}dt\]

Example

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

Output:

1.31615 + 0.190453j

References