Skip to content

polykin.math¤

ierfc ¤

ierfc(x: float) -> float

Integral of the complementary error function.

\[ \mathrm{ierfc}(x) = \int_x^{\infty}\mathrm{erfc}(\xi)d\xi \]
PARAMETER DESCRIPTION
x

Argument.

TYPE: float

RETURNS DESCRIPTION
float

Value of the integral.

Examples:

>>> ierfc(0.5)
0.1996412283742457
Source code in src/polykin/math/special.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def ierfc(x: float) -> float:
    r"""Integral of the complementary error function.

    $$ \mathrm{ierfc}(x) = \int_x^{\infty}\mathrm{erfc}(\xi)d\xi $$

    Parameters
    ----------
    x : float
        Argument.

    Returns
    -------
    float
        Value of the integral.

    Examples
    --------
    >>> ierfc(0.5)
    0.1996412283742457
    """
    if x > 30.:
        return 0.
    else:
        return exp(-x**2)/sqrt(pi) - x*erfc(x)