- §3.10(i) Introduction
- §3.10(ii) Relations to Power Series
- §3.10(iii) Numerical Evaluation of Continued Fractions

See §1.12 for relevant properties of continued fractions, including the following definitions:

3.10.1 | $$C={b}_{0}+\frac{{a}_{1}}{{b}_{1}+}\frac{{a}_{2}}{{b}_{2}+}\mathrm{\cdots},$$ | ||

${a}_{n}\ne 0$, | |||

3.10.2 | $${C}_{n}={b}_{0}+\frac{{a}_{1}}{{b}_{1}+}\frac{{a}_{2}}{{b}_{2}+}\mathrm{\cdots}\frac{{a}_{n}}{{b}_{n}}=\frac{{A}_{n}}{{B}_{n}}.$$ | ||

${C}_{n}$ is the $n$th *approximant* or *convergent* to $C$.

Every convergent, asymptotic, or formal series

3.10.3 | $${u}_{0}+{u}_{1}+{u}_{2}+\mathrm{\cdots}$$ | ||

can be converted into a continued fraction $C$ of type (3.10.1), and with the property that the $n$th convergent ${C}_{n}={A}_{n}/{B}_{n}$ to $C$ is equal to the $n$th partial sum of the series in (3.10.3), that is,

3.10.4 | $$\frac{{A}_{n}}{{B}_{n}}={u}_{0}+{u}_{1}+\mathrm{\dots}+{u}_{n},$$ | ||

$n=0,1,\mathrm{\dots}$. | |||

For instance, if none of the ${u}_{n}$ vanish, then we can define

3.10.5 | ${b}_{0}$ | $={u}_{0},$ | ||

${b}_{1}$ | $=1,$ | |||

${a}_{1}$ | $={u}_{1},$ | |||

${b}_{n}$ | $=1+{\displaystyle \frac{{u}_{n}}{{u}_{n-1}}},$ | |||

${a}_{n}$ | $=-{\displaystyle \frac{{u}_{n}}{{u}_{n-1}}}$, | |||

$n\ge 2$. | ||||

However, other continued fractions with the same limit may converge in a much larger domain of the complex plane than the fraction given by (3.10.4) and (3.10.5). For example, by converting the Maclaurin expansion of $\mathrm{arctan}z$ (4.24.3), we obtain a continued fraction with the same region of convergence ($\left|z\right|\le 1$, $z\ne \pm \mathrm{i}$), whereas the continued fraction (4.25.4) converges for all $z\in \u2102$ except on the branch cuts from $\mathrm{i}$ to $\mathrm{i}\mathrm{\infty}$ and $-\mathrm{i}$ to $-\mathrm{i}\mathrm{\infty}$.

A continued fraction of the form

3.10.6 | $$C=\frac{{a}_{0}}{1-}\frac{{a}_{1}z}{1-}\frac{{a}_{2}z}{1-}\mathrm{\cdots}$$ | ||

is called a *Stieltjes fraction ($S$-fraction)*. We say that it
*corresponds* to the formal power series

3.10.7 | $$f(z)={c}_{0}+{c}_{1}z+{c}_{2}{z}^{2}+\mathrm{\cdots}$$ | ||

if the expansion of its $n$th convergent ${C}_{n}$ in ascending powers of $z$ agrees with (3.10.7) up to and including the term in ${z}^{n-1}$, $n=1,2,3,\mathrm{\dots}$.

For several special functions the $S$-fractions are known explicitly, but in
any case the coefficients ${a}_{n}$ can always be calculated from the power-series
coefficients by means of the *quotient-difference algorithm*; see
Table 3.10.1.

The first two columns in this table are defined by

3.10.8 | ${e}_{0}^{n}$ | $=0,$ | ||

$n=1,2,\mathrm{\dots}$, | ||||

${q}_{1}^{n}$ | $={c}_{n+1}/{c}_{n},$ | |||

$n=0,1,\mathrm{\dots}$, | ||||

where the ${c}_{n}$ ($\ne 0$) appear in (3.10.7). We continue by
means of the *rhombus rule*

3.10.9 | ${e}_{j}^{k}$ | $={e}_{j-1}^{k+1}+{q}_{j}^{k+1}-{q}_{j}^{k},$ | ||

$j\ge 1$, $k\ge 0$, | ||||

${q}_{j+1}^{k}$ | $={q}_{j}^{k+1}{e}_{j}^{k+1}/{e}_{j}^{k},$ | |||

$j\ge 1$, $k\ge 0$. | ||||

Then the coefficients ${a}_{n}$ of the $S$-fraction (3.10.6) are given by

3.10.10 | ${a}_{0}$ | $={c}_{0},$ | ||

${a}_{1}$ | $={q}_{1}^{0},$ | |||

${a}_{2}$ | $={e}_{1}^{0},$ | |||

${a}_{3}$ | $={q}_{2}^{0},$ | |||

${a}_{4}$ | $={e}_{2}^{0},$ | |||

$\mathrm{\dots}.$ | ||||

The quotient-difference algorithm is frequently unstable and may require high-precision arithmetic or exact arithmetic. A more stable version of the algorithm is discussed in Stokes (1980). For applications to Bessel functions and Whittaker functions (Chapters 10 and 13), see Gargantini and Henrici (1967).

A continued fraction of the form

3.10.11 | $$C=\frac{{\beta}_{0}}{1-{\alpha}_{0}z-}\frac{{\beta}_{1}{z}^{2}}{1-{\alpha}_{1}z-}\frac{{\beta}_{2}{z}^{2}}{1-{\alpha}_{2}z-}\mathrm{\cdots}$$ | ||

is called a *Jacobi fraction ($J$-fraction)*. We say that it is
*associated* with the formal power series $f(z)$ in
(3.10.7) if the expansion of its $n$th convergent ${C}_{n}$ in
ascending powers of $z$, agrees with (3.10.7) up to and
including the term in ${z}^{2n-1}$, $n=1,2,3,\mathrm{\dots}$. For the same function
$f(z)$, the convergent ${C}_{n}$ of the Jacobi fraction (3.10.11)
equals the convergent ${C}_{2n}$ of the Stieltjes fraction
(3.10.6).

For special functions see §5.10 (gamma function), §7.9 (error function), §8.9 (incomplete gamma functions), §8.17(v) (incomplete beta function), §8.19(vii) (generalized exponential integral), §§10.10 and 10.33 (quotients of Bessel functions), §13.6 (quotients of confluent hypergeometric functions), §13.19 (quotients of Whittaker functions), and §15.7 (quotients of hypergeometric functions).

To compute the ${C}_{n}$ of (3.10.2) we perform the iterated divisions

3.10.12 | ${u}_{n}$ | $={b}_{n},$ | ||

${u}_{k}$ | $={b}_{k}+{\displaystyle \frac{{a}_{k+1}}{{u}_{k+1}}}$, | |||

$k=n-1,n-2,\mathrm{\dots},0$. | ||||

Then ${u}_{0}={C}_{n}$. To achieve a prescribed accuracy, either *a priori*
knowledge is needed of the value of $n$, or $n$ is determined by trial and
error. In general this algorithm is more stable than the forward algorithm; see
Jones and Thron (1974).

The continued fraction

3.10.13 | $$C=\frac{{a}_{0}}{1-}\frac{{a}_{1}}{1-}\frac{{a}_{2}}{1-}\mathrm{\cdots}$$ | ||

can be written in the form

3.10.14 | $$C=\sum _{k=0}^{\mathrm{\infty}}{t}_{k},$$ | ||

where

3.10.15 | ${t}_{0}$ | $={a}_{0},$ | ||

${t}_{k}$ | $={\rho}_{k}{t}_{k-1},$ | |||

${\rho}_{0}$ | $=0,$ | |||

${\rho}_{k}$ | $={\displaystyle \frac{{a}_{k}(1+{\rho}_{k-1})}{1-{a}_{k}(1+{\rho}_{k-1})}}$, | |||

$k=1,2,3,\mathrm{\dots}$. | ||||

The $n$th partial sum ${t}_{0}+{t}_{1}+\mathrm{\dots}+{t}_{n-1}$ equals the $n$th convergent
of (3.10.13), $n=1,2,3,\mathrm{\dots}$. In contrast to the preceding
algorithms in this subsection no scaling problems arise and no *a priori*
information is needed.

This forward algorithm achieves efficiency and stability in the computation of
the convergents ${C}_{n}={A}_{n}/{B}_{n}$, and is related to the forward series
recurrence algorithm. Again, no scaling problems arise and no *a priori*
information is needed.

Let

3.10.16 | ${C}_{0}$ | $={b}_{0},$ | ||

${D}_{1}$ | $=1/{b}_{1},$ | |||

$\nabla {C}_{1}$ | $={a}_{1}{D}_{1},$ | |||

${C}_{1}$ | $={C}_{0}+\nabla {C}_{1}.$ | |||

($\nabla $ is the *backward difference operator*.) Then for $n\ge 2$,

3.10.17 | ${D}_{n}$ | $={\displaystyle \frac{1}{{D}_{n-1}{a}_{n}+{b}_{n}}},$ | ||

$\nabla {C}_{n}$ | $=({b}_{n}{D}_{n}-1)\nabla {C}_{n-1},$ | |||

${C}_{n}$ | $={C}_{n-1}+\nabla {C}_{n}.$ | |||

The recurrences are continued until $(\nabla {C}_{n})/{C}_{n}$ is within a prescribed relative precision.

For further information on the preceding algorithms, including convergence in the complex plane and methods for accelerating convergence, see Blanch (1964) and Lorentzen and Waadeland (1992, Chapter 3). For the evaluation of special functions by using continued fractions see Cuyt et al. (2008), Gautschi (1967, §1), Gil et al. (2007a, Chapter 6), and Wimp (1984, Chapter 4, §5). See also §§6.18(i), 7.22(i), 8.25(iv), 10.74(v), 14.32, 28.34(ii), 29.20(i), 30.16(i), 33.23(v).