# Other Special Functions

## `ArithmeticGeometricMean(x, y): RngSerElt, RngSerElt -> RngSerElt`

## `AGM(f, g): RngSerElt, RngSerElt -> RngSerElt`

Return the hyperbolic arithmetic-geometric mean of the series $f$ and $g$ defined over a field. The valuations of $f$ and $g$ must be equal.

## `ArithmeticGeometricMean(x, y): FldReElt, FldReElt -> FldReElt`

## `AGM(x, y): FldReElt, FldReElt -> FldReElt`

Returns the arithmetic-geometric mean of the real or complex numbers $x$ and $y$, defined as the limit of either of the sequences $x_i, y_i$ where $x_0 = x$, $y_0 = y$ and $x_{i+1} = (x_i + y_i)/2, y_{i+1} = \sqrt{x_i y_i}$. The function calculates both sequences, and when the numbers are within the desired precision of each other, it returns one of them.

## `BernoulliNumber(n): RngIntElt -> FldRatElt`

For a non-negative integer $n$, return the value of the $n$-th Bernoulli number $B_n$, defined by

$$
{t\over e^t-1}=\sum_{n=0}^\infty B_n{t^n\over n!}.
$$

## `BernoulliApproximation(n): RngIntElt -> FldReElt`

For a non-negative integer $n$, return an approximation in the field of real numbers to the value of the $n$-th Bernoulli number $B_n$, defined by

$$
{t\over e^t-1}=\sum_{n=0}^\infty B_n{t^n\over n!}.
$$

## `DawsonIntegral(r): FldReElt -> FldReElt`

Given a real number $r$, compute the value of *Dawson’s integral*,

$$
e^{-x^2}\cdot\int_0^xe^{u^2} du,
$$

at $x = r$.

## `ErrorFunction(r): FldReElt -> FldReElt`

## `Erf(r): FldReElt -> FldReElt`

Given a real number $r$, calculate the value of the *error function* ${\operatorname{erf}}$. This is the value of

$$
\sqrt{4\over \pi}\cdot \int_0^xe^{-u^2} du,
$$

at $x = r$ for $r>0$, and for $r<0$ it is defined by ${\operatorname{erf}}(x)=-{\operatorname{erf}}(-x)$, while ${\operatorname{erf}}(0)=0$.

## `ComplementaryErrorFunction(r): FldReElt -> FldReElt`

## `Erfc(r): FldReElt -> FldReElt`

Given a real number $r$, calculate the value of the *complementary error function*. This is the value of $y = {\rm erfc}(x) = 1 - {\operatorname{erf}}(x)$ for the error function ${\operatorname{erf}}$ as defined above.

## `ExponentialIntegral(r): FldReElt -> FldReElt`

Given a real number $r$, calculate the value of the *exponential integral*, that is, the principal value of

$$
\int_{-\infty}^x{e^u\over u}du
$$

at $x = r$.

## `ExponentialIntegralE1(r): FldReElt -> FldReElt`

Given a real number $r$, calculate the value of the *exponential integral E1*, that is, the principal value of

$$
\int_x^{\infty}{e^{-u}\over u}du
$$

at $x = r$.

## `LogIntegral(r): FldReElt -> FldReElt`

Given a non-negative real number $r$ that is not equal to 1, evaluate the *logarithmic integral* $y = {\operatorname{li}}(x)$ at $x = r$. This integral is defined to be the principal value of $\int_0^x{1\over \log(u)}du.$

## `ZetaFunction(s): FldReElt -> FldReElt`

## `ZetaFunction(R, n): FldRe, RngIntElt -> FldReElt`

These functions calculate values of the Riemann $\zeta$-function, which is the analytic continuation of

$$
\zeta(z)=\sum_{i=1}^\infty{1\over i^z}
$$

(convergent for Re$(z)> 1$). The version with one argument takes a real or complex number $r\neq 1$ and returns a real or complex number. The version with two arguments is much more restricted; it takes a real field $R$ and an integer $n \neq 1$, and returns $\zeta(n)$ in $R$.

MPFR uses the algorithm of Jean-Luc Rémy and Sapphorain Pétermann [[Pétermann and Rémy, 2006](../../references.md#cite-pere06)].
