# §15.19 Methods of Computation

## §15.19(i) Maclaurin Expansions

The Gauss series (15.2.1) converges for $|z|<1$. For $z\in\Real$ it is always possible to apply one of the linear transformations in §15.8(i) in such a way that the hypergeometric function is expressed in terms of hypergeometric functions with an argument in the interval $[0,\frac{1}{2}]$.

For $z\in\Complex$ it is possible to use the linear transformations in such a way that the new arguments lie within the unit circle, except when $z=e^{\pm\pi i/3}$. This is because the linear transformations map the pair $\{e^{\pi i/3},e^{-\pi i/3}\}$ onto itself. However, by appropriate choice of the constant $z_{0}$ in (15.15.1) we can obtain an infinite series that converges on a disk containing $z=e^{\pm\pi i/3}$. Moreover, it is also possible to accelerate convergence by appropriate choice of $z_{0}$.

Large values of $|a|$ or $|b|$, for example, delay convergence of the Gauss series, and may also lead to severe cancellation.

For fast computation of $\mathop{F\/}\nolimits\!\left(a,b;c;z\right)$ with $a,b$ and $c$ complex, and with application to Pöschl–Teller-Ginocchio potential wave functions, see Michel and Stoitsov (2008).

For further information see Bühring (1987a), Forrey (1997), Kalla (1992) and López and Temme (2013).

## §15.19(ii) Differential Equation

A comprehensive and powerful approach is to integrate the hypergeometric differential equation (15.10.1) by direct numerical methods. As noted in §3.7(ii), the integration path should be chosen so that the wanted solution grows in magnitude at least as fast as all other solutions. However, since the growth near the singularities of the differential equation is algebraic rather than exponential, the resulting instabilities in the numerical integration might be tolerable in some cases.

## §15.19(iii) Integral Representations

The representation (15.6.1) can be used to compute the hypergeometric function in the sector $|\mathop{\mathrm{ph}\/}\nolimits\!\left(1-z\right)|<\pi$. Gauss quadrature approximations are discussed in Gautschi (2002b).

## §15.19(iv) Recurrence Relations

The relations in §15.5(ii) can be used to compute $\mathop{F\/}\nolimits\!\left(a,b;c;z\right)$, provided that care is taken to apply these relations in a stable manner; see §3.6(ii). Initial values for moderate values of $|a|$ and $|b|$ can be obtained by the methods of §15.19(i), and for large values of $|a|$, $|b|$, or $|c|$ via the asymptotic expansions of §§15.12(ii) and 15.12(iii).

For example, in the half-plane $\realpart{z}\leq\frac{1}{2}$ we can use (15.12.2) or (15.12.3) to compute $\mathop{F\/}\nolimits\!\left(a,b;c+N+1;z\right)$ and $\mathop{F\/}\nolimits\!\left(a,b;c+N;z\right)$, where $N$ is a large positive integer, and then apply (15.5.18) in the backward direction. When $\realpart{z}>\frac{1}{2}$ it is better to begin with one of the linear transformations (15.8.4), (15.8.7), or (15.8.8). For further information see Gil et al. (2006c, 2007b).

## §15.19(v) Continued Fractions

In Colman et al. (2011) an algorithm is described that uses expansions in continued fractions for high-precision computation of the Gauss hypergeometric function, when the variable and parameters are real and one of the numerator parameters is a positive integer. The accuracy is controlled and validated by a running error analysis coupled with interval arithmetic.