# §6.18 Methods of Computation

## §6.18(i) Main Functions

For small or moderate values of $x$ and $|z|$, the expansion in power series (§6.6) or in series of spherical Bessel functions (§6.10(ii)) can be used. For large $x$ or $|z|$ these series suffer from slow convergence or cancellation (or both). However, this problem is less severe for the series of spherical Bessel functions because of their more rapid rate of convergence, and also (except in the case of (6.10.6)) absence of cancellation when $z=x$ ($>0$).

For large $x$ and $\left|z\right|$, expansions in inverse factorial series (§6.10(i)) or asymptotic expansions (§6.12) are available. The attainable accuracy of the asymptotic expansions can be increased considerably by exponential improvement. Also, other ranges of $\mathop{\mathrm{ph}\/}\nolimits z$ can be covered by use of the continuation formulas of §6.4.

Quadrature of the integral representations is another effective method. For example, the Gauss-Laguerre formula (§3.5(v)) can be applied to (6.2.2); see Todd (1954) and Tseng and Lee (1998). For an application of the Gauss-Legendre formula (§3.5(v)) see Tooper and Mark (1968).

Lastly, the continued fraction (6.9.1) can be used if $|z|$ is bounded away from the origin. Convergence becomes slow when $z$ is near the negative real axis, however.

## §6.18(ii) Auxiliary Functions

Power series, asymptotic expansions, and quadrature can also be used to compute the functions $\mathop{\mathrm{f}\/}\nolimits\!\left(z\right)$ and $\mathop{\mathrm{g}\/}\nolimits\!\left(z\right)$. In addition, Acton (1974) developed a recurrence procedure, as follows. For $n=0,1,2,\dots$, define

 6.18.1 $\displaystyle A_{n}$ $\displaystyle=\int_{0}^{\infty}\frac{te^{-zt}}{1+t^{2}}\left(\frac{t^{2}}{1+t^% {2}}\right)^{n}dt,$ $\displaystyle B_{n}$ $\displaystyle=\int_{0}^{\infty}\frac{e^{-zt}}{1+t^{2}}\left(\frac{t^{2}}{1+t^{% 2}}\right)^{n}dt,$ $\displaystyle C_{n}$ $\displaystyle=\int_{0}^{\infty}e^{-zt}\left(\frac{t^{2}}{1+t^{2}}\right)^{n}dt.$

Then $\mathop{\mathrm{f}\/}\nolimits\!\left(z\right)=B_{0}$, $\mathop{\mathrm{g}\/}\nolimits\!\left(z\right)=A_{0}$, and

 6.18.2 $\displaystyle A_{n-1}$ $\displaystyle=A_{n}+\frac{z}{2n}C_{n},$ $\displaystyle B_{n-1}$ $\displaystyle=\frac{2nB_{n}+zA_{n-1}}{2n-1},$ $\displaystyle C_{n-1}$ $\displaystyle=C_{n}+B_{n-1}$, $n=1,2,3,\dots.$ Symbols: $z$: complex variable and $n$: nonnegative integer Permalink: http://dlmf.nist.gov/6.18.E2 Encodings: TeX, TeX, TeX, pMML, pMML, pMML, png, png, png

$A_{0}$, $B_{0}$, and $C_{0}$ can be computed by Miller’s algorithm (§3.6(iii)), starting with initial values $(A_{N},B_{N},C_{N})=(1,0,0)$, say, where $N$ is an arbitrary large integer, and normalizing via $C_{0}=1/z$.

## §6.18(iii) Zeros

Zeros of $\mathop{\mathrm{Ci}\/}\nolimits\!\left(x\right)$ and $\mathop{\mathrm{si}\/}\nolimits\!\left(x\right)$ can be computed to high precision by Newton’s rule (§3.8(ii)), using values supplied by the asymptotic expansion (6.13.2) as initial approximations.

## §6.18(iv) Other References

For a comprehensive survey of computational methods for the functions treated in this chapter, see van der Laan and Temme (1984, Ch. IV).