Hypergeometric Final
Hypergeometric Final
Hypergeometric Final
DOI 10.1007/s11075-016-0173-0
ORIGINAL PAPER
Abstract The two most commonly used hypergeometric functions are the conflu-
ent hypergeometric function and the Gauss hypergeometric function. We review the
available techniques for accurate, fast, and reliable computation of these two hyper-
geometric functions in different parameter and variable regimes. The methods that we
investigate include Taylor and asymptotic series computations, Gauss–Jacobi quadra-
ture, numerical solution of differential equations, recurrence relations, and others. We
discuss the results of numerical experiments used to determine the best methods, in
practice, for each parameter and variable regime considered. We provide “roadmaps”
with our recommendation for which methods should be used in each situation.
This work was supported by the Numerical Algorithms Group (NAG) and the Engineering and
Physical Sciences Research Council (EPSRC).
John W. Pearson
[email protected]
Sheehan Olver
[email protected]
Mason A. Porter
[email protected]
2 School of Mathematics and Statistics, The University of Sydney, NSW 2006, Sydney, Australia
3 Oxford Centre for Industrial and Applied Mathematics, Mathematical Institute, University of
Oxford, Andrew Wiles Building, Radcliffe Observatory Quarter, Woodstock Road, Oxford,
OX2 6GG, UK
Numer Algor
1 Introduction
The aim of this review paper is to summarize methods for computing the two most
commonly used hypergeometric functions: the confluent hypergeometric function
M(a; b, z) and the Gauss hypergeometric function F(a, b; c; z). (We also consider
the associated functions 1 F1 (a; b; z) and 2 F1 (a, b; c; z).) We overview methods that
have been developed for computing M and F, and we discuss how to choose appropri-
ate methods for different parameter and variable regimes. We thereby obtain reliable
and fast computation for a large range of the parameters (a and b for M; and a, b, and
c for F) and the variable z. Because accurate error bounds are seldomly available, we
test a large variety of approaches, which we require to be stable, accurate, fast, and
robust within the parameter and variable regions for which they have been selected.
This is especially important when working with finite-precision arithmetic.
The computation of confluent hypergeometric functions and Gauss hypergeomet-
ric functions is important in a wide variety of applications [87]. For instance, these
functions arise in areas such as photon scattering from atoms [27], networks [79,
100], Coulomb wave functions [8, 21, 67], binary stars [81], mathematical finance
[10], non-Newtonian fluids [109], and more.
Except for specific situations, computing hypergeometric functions is difficult in
practice. A plethora of methods exist for computing each hypergeometric function;
these include Taylor series, asymptotic expansions, continued fractions, recurrence
relationships, hyperasymptotic expansions, and more. However, each method is only
reliable and efficient for limited parameter and variable regimes. Consequently, one
must be prepared to use different members of this suite of possibilities in different
regimes of parameter and variable values.
We have also developed M ATLAB code for computing the functions M and F using
a range of methods; our code is publicly available [116].
The function M is entire (i.e., it is analytic throughout the complex plane C) in the
parameters a and b and the variable z. Therefore, the sum (2.1) always converges.
Numer Algor
which is also commonly denoted by M(a; b; z) and is itself often called the confluent
hypergeometric function. Because 1 F1 (a; b; z) is not defined if b is equal to a non-
positive integer and there are numerical issues in its computation if b is close to a
non-positive integer, it is preferable to compute M when possible.
The Gauss hypergeometric function is defined within the unit disk |z| < 1 by
[110, Eq. (15.2.2)]
∞
(a)j (b)j zj
F(a, b; c; z) = (2.2)
(c + j ) j !
j =0
and defined outside the unit disk by analytic continuation, with a principal branch
cut along [1, ∞). On [1, ∞), it is defined to be continuous from below. That is,
F(a, b; c; z) = lim→0 F(a, b; c; z − ||i). When c is not a non-positive integer, we
define
⎛ ⎞
∞
(a)j (b)j zj
2 F1 (a, b; c; z) = (c)F(a, b; c; z) ⎝= for |z| < 1⎠ . (2.3)
(c)j j !
j =0
100 4
3
50
F (a,b;c;z)
F (a;b;z)
2
1 1
2 1
0 1
0
−50
−5 0 5 −1 −0.5 0 0.5 1
z z
Fig. 1 (Color online) (Left) Plots of 1 F1 (a; b; z), generated using M ATLAB [111], for real z ∈ [−5, 5]
with parameter values (a, b) = (0.1, 0.2) in dark blue (dotted), (a, b) = (−3.8, 1.5) in red (dashed),
and (a, b) = (−3, −2.5) in green (solid). (Right) Plots of 2 F1 for real z ∈ [−1, 1] with parameter val-
ues (a, b, c) = (0.1, 0.2, 0.4) in black (dotted), (a, b, c) = (−3.6, −0.7, −2.5) in purple (dashed), and
(a, b, c) = (−5, 1.5, 6.2) in sky blue (solid)
computational techniques are accurate and efficient for different parameter and vari-
able regimes. It is also important to supply information on how to test the reliability
of a routine, provide test cases that a routine might have difficulty computing (see
Appendix A), and indicate how to evaluate other special functions required for the
computation of hypergeometric functions (see Appendix C). As illustrated in Ref.
[80], the inbuilt routines to compute hypergeometric functions in commercial soft-
ware packages such as M ATLAB R2015a [111] and Mathematica 8 [112] are not
without limitations, so one should not rely on them in many parameter and vari-
able regimes. We have implemented our routines for M ATLAB R2015a, which uses
double-precision arithmetic, and we have made it freely available online [116]. Of
course, it is easier to obtain accurate results when computing these functions in
higher-precision arithmetic, as is done when the inbuilt hypergeometric function
commands in M ATLAB and M ATHEMATICA are called. Our code can be modified to
run in higher precision.
100 60
|2F1(a,b;c;z)|
|1F1(a;b;z)|
40
50
20
0 0
5 5
5 5
0 0 0 0
Im(z) −5 −5 Re(z) Im(z) −5 −5 Re(z)
Fig. 2 (Color online) (Left) Plot of |1 F1 (a; b; z)| for (Re(z), Im(z))
∈ [−5, 5] with parameter val-
2
ues (a, b) = (−3 − 2i, 2.5). (Right) Plot of |2 F1 | for Re(z), Im(z) ∈ [−5, 5]2 with parameter values
(a, b, c) = (1 + 2i, −1.5, 0.5 − i)
Numer Algor
In this section, we discuss the methods that perform the best in practice for accu-
rately and efficiently evaluating the confluent hypergeometric function. The range
of methods that we discuss includes series computation methods (Sections 3.2, 3.3,
and 3.4), quadrature methods (Section 3.5), recurrence relations (Section 3.6), and
other methods (Section 3.7). In Section 3.8, we summarize the computational strate-
gies and provide recommendations for the most effective approaches for a variety of
parameter regimes.
3.1 Properties of M
π 1 z1−b
U (a; b; z) = M(a; b; z) − M(1 + a − b; 2 − b; z) .
sin(π b) (1 + a − b) (a)
The function U (a; b; z) is defined with a principal branch cut along (−∞, 0].
When m ∈ Z, one obtains [110, Eq. (13.2.12)]
e∓aπi e±(b−a)πi z
M(a; b; z) = U (a; b; z) + e U (b − a; b; e±πi z) . (3.1)
(b − a) (a)
Therefore, methods for computing U (a; b; z) can also be useful for computing
M, and vice-versa, provided one is careful about numerical issues such as cancella-
tion. One can also exploit methods for computing 1 F1 in conjunction with the above
expressions, as well as the transformation [110, Eq. (13.2.39)]
Method (b) The following three-term recurrence relation can be used to obtain
approximations of M(a; b; z) recursively in terms of previous approximations [63]:
S−1 = S0 = 1 , S1 = 1 + ab z ,
a+j −1
rj = j (b+j −1) , Sj = Sj −1 + (Sj −1 − Sj −2 )rj z, j = 2, 3, . . . .
As one can see in Table 9 in Appendix B, Methods (a) and (b) generate similar
results and require the same number of terms for most computations. However, as
also illustrated by Table 9, Method (b) is in general more effective when carrying out
computations involving small parameters.
By examining the coefficients of the series, we see that SN converges par-
ticularly quickly when z is close to 0 or when b has a large real part and a
relatively small imaginary part (because (·)−1 decays rapidly near the positive
real axis); again see Table 9. We note that (3.3) can be viewed as an asymptotic
expansion for large values of |b| and bounded a, z, which explains this feature.
However, as a or z becomes large, the coefficients of the Taylor series become
large, slowing down the convergence rate (see Fig. 3). See Table 9, where the
Numer Algor
200
100
50
0
0 20 40 60 80 100
z
Fig. 3 (Color online) Number of terms that need to be computed using Taylor series Method (a) for
evaluating 1 F1 (and hence M) for real z ∈ [1, 100] when a = 2 and b = 3 (red, dashed), a = 2 + 10i
and b = 10 + 5i (green, solid), and a = 20 and b = 15 (blue, dotted) before the stopping criterion (two
successive small terms) is satisfied. The method gives results to 15-digit accuracy
Taylor series is accurate up to and even beyond |z| = 100 (although the approx-
imation becomes less accurate as |z| → ∞), depending on the parameter values
involved.
As demonstrated by cases 13–16 in Table 9, a significant issue with computing M
using Taylor series is cancellation. Although |a| and |z| are the same in each of these
cases, a Taylor series method is effective in these cases if a and z have the same signs,
whereas it is ineffective if their signs are different. In this situation, we find that the
Buchholz polynomial expansion that we describe in Section 3.3 is more effective.
Method (c)
αj = (αj −1 + βj −1 )j (b + j − 1) , (3.4)
βj = βj −1 (a + j − 1)z ,
γj = γj −1 j (b + j − 1) ,
αj + βj
Sj = , j = 1, 2, . . . .
γj
Implementing this method generates a sequence of approximations to 1 F1 (a; b; z)
(i.e., approximations of Sj for j = 1, 2, . . .), which we terminate using the same
stopping criterion as in Section 3.2.
From Table 9, one can conclude that Methods (a) and (b) generate accurate compu-
tations of M(a; b; z) more successfully than Method (c) for a wide range of parameter
and variable values. One possible explanation for this—especially as the moduli of
the parameter values become increasingly large—is that the terms in the numerator
and denominator of Sj become very large for relatively small j , so numerical issues
such as round-off error and cancellation can become significant when carrying out the
computations. Additionally, we often find that either the numerator or the denomina-
tor of Sj becomes very large after only a few summations. Nevertheless, we observe
that Method (c) can be useful if |b| is small (especially when |b| 1), provided |a| is
not too large, whereas if one uses Methods (a) and (b) when |b| is small, the round-
off error can become costly if many terms are too large. Therefore, a method with a
single division can potentially aid accurate computation in this case, as the effect of
round-off error is reduced.
To illustrate many of the effects observed in this section, in Table 1 we present
a handful of examples for which one method performs significantly worse than the
other two. This highlights the need to take care when selecting an appropriate strat-
egy, in particular for small parameters (when Method (a) in particular can be less
effective) and large values of |z| (when Method (c) struggles for the reasons explained
above).
References [1, 2] used Buchholz polynomials to derive expressions for M(a; b; z),
focusing on the regime of real parameters and a real variable. We find that this yields
Numer Algor
Table 1 Computed values of M(a; b; z) using Methods (a), (b), and (c) for several examples and fixed
numbers N of computed terms. Incorrect digits are written in bold
a much more effective approach than the methods discussed in Section 3.2 for the
computation of M(a; b; z) when sign(a) = −sign(z).
The function M(a; b; z) can expanded in terms of Buchholz polynomials pj (b, z)
as follows:
∞ √
Jb−1+j ( z{2b − 4a})
M(a; b; z) = e 2
z/2 b−1
pj (b, z) 1
(3.5)
j =0 (z{2b − 4a}) 2 (b−1+j )
iz 2 iz
M(a; 2a; z) = ez/2 Ja− 1 ,
(2a) 4 2 2
where Jν (z) denotes the Bessel function of the first kind. The coefficients of (3.5) are
j
2
(iz)j j
pj (b, z) = fs (b)gj −2s (z) , (3.6)
j! 2s
s=0
where
s−1
b 2s − 1 4s−j B2(s−j )
f0 (b) = 1, fs (b) = − −1 fj (b) , s = 1, 2, . . . ,
2 2j s−j
j =0
s−1
iz s − 1 4j +1 B2(j +1)
2
The coefficients Bj denote the Bernoulli numbers, which are defined by the
generating function
∞
z zj
= B j .
ez − 1 j!
j =0
A more convenient form of (3.5), which utilizes recurrence relations for the
Buchholz polynomials, for real a (there are no such restrictions on the values of b
and z) is as follows [2]:
∞ √
j Jb−1+j ( z{2b − 4a})
M(a; b; z) = e 2
z/2 b−1
Dj z 1
, (3.7)
j =0 (z{2b − 4a}) 2 (b−1+j )
where
b
D0 = 1 , D1 = 0 , D2 = ,
2
j Dj = (j − 2 + b)Dj −2 + (2a − b)Dj −3 , j = 3, 4, . . . . (3.8)
The expression in (3.7) is the series that we implement in our code and provides
an expansion for the confluent hypergeometric function in terms of Bessel functions,
which are significantly easier to compute than M. We evaluate terms of (3.7) until
the magnitudes of two successive terms are smaller than eps multiplied by the mag-
nitude of the computed series up to that point. (We typically compute the Bessel
functions using series expansions with the same stopping conditions as for M in
Section 3.2; see Appendix C for more details.)
As illustrated in Table 9, this method seems to outperform the Taylor series meth-
ods of Section 3.2 for computation of M for certain parameter regimes, and this is
particularly true for many examples in which sign(a)
= sign(z). The method is also
valuable for moderate complex values of a and z (in particular, for 10 |a| , |z|
100), especially when the real parts of a and z have opposite signs. The Taylor series
methods discussed in Section 3.2 and the single-fraction method of Section 3.2.1 do
not give accurate computations with these cases, but the method described in this
section performs very well. (See Table 9 in Appendix B.) One even obtains a very
accurate result when |a| is large (e.g., when |a| = 500), with real z of opposite sign
to that of a. (See case 19 in Appendix A, for which we obtain 16-digit accuracy.)
As illustrated in Appendix B, however, this method becomes less successful as |z|
becomes larger. Nonetheless, the good performance of this method for a large range
of parameter values makes it a convenient element of one’s toolbox for computing
M(a; b; z).
The methods that we outlined in Sections 3.2 and 3.3 were all ineffective (in general)
for large values of |z|. (We found that these methods ceased to be effective for |z|
100, although the threshold was sometimes lower, depending on the precise values
of the parameters.) In this section, we aim to address this issue by using large-|z|
asymptotic formulas for computing the confluent hypergeometric function.
Numer Algor
One can apply Watson’s lemma [104] to show that as |z| → ∞, the hypergeomet-
ric function M(a; b; z) satisfies [3]
ez za−b
∞
(b−a)j (1−a)j −j
M(a; b; z) ∼ (a) j! z (3.9)
j =0
±π ia −a ∞ (a)j (1+a−b)j
+ e(b−a)
z
j =0 j! (−z)−j ,
1 As in [3], when we write “±”, the sign “+” is used if − 12 π < arg z < 32 π, and “−” is used if − 32 π <
arg z < 12 π. The argument is assigned the limits ± 32 π − δ and ± − 12 π + δ to ensure validity of the
expansion over the branch cut.
2 We define the hypergeometric function F as follows:
2 0
∞
zj
2 F0 (a, b; −; z) = (a)j (b)j .
j!
j =0
Numer Algor
that one can use to compute M via the expression (3.1). A uniform, exponentially
improved asymptotic expansion is derived in [74, 77], and a second expansion with
this property is derived in Ref. [68]. This was in turn extended in Ref. [72] to a
hyperasymptotic expansion, which offers another possibility for computing M for
large |z|.
There has also been research on uniform asymptotic expansions of M(a; b; z) for
large, real values of the parameters a and b. For example, reference [98] derived an
expansion for large (real and positive) values of b and z in terms of parabolic cylin-
der functions. (We discuss methods for computing parabolic cylinder functions in
Appendix C.) Reference [99] gave an expansion for U (a; b; z) for large values of a
(which must be real and positive) and b ≤ 1 in terms of modified Bessel functions
(which are themselves expressible in terms of Bessel functions [110]). We also rec-
ommend the new book [92] for a summary of asymptotic results for the confluent
hypergeometric function.
Thus far, we have only considered methods based on series. In this section, we dis-
cuss a class of methods for computing M(a; b; z) using its integral representation for
a, b ∈ R with b > a > 0.
When Re(b) > Re(a) > 0, the function M(a; b; z) has the integral representation
[3]
1
1
M(a; b; z) = ezt (1 − t)b−a−1 t a−1 dt . (3.11)
(a)(b − a) 0
Applying the transformation t → 12 t + 12 and using the Jacobi parameters α =
= a − 1, for real b > a > 0, yields [26]
b − a − 1 and β
1 1 1
1 z t+
M(a; b; z) = b−1 e 2 2 (1 − t)b−a−1 (1 +
t)a−1 d
t
2 (a)(b − a) −1
⎡ Nmesh
⎤
1 e z/2 GJ
= ⎣ wjGJ eztj /2 + ENmesh (a; b; z)⎦ ,
(a)(b − a) 2b−1
j =1
where tjGJ and wjGJ are (respectively) the Gauss–Jacobi nodes and weights on
[−1, 1] and Nmesh is the number of mesh points.
This method is known as Gauss–Jacobi quadrature. The error ENmesh for this
method can be controlled by Nmesh , which one can determine for real a, b, and z
using the following relation [26]:
e |z| 4 1
Nmesh ≥ t z+ + (3 − 2b) log 2 + log , (3.12)
8 e |z| ENmesh
Table 2 Number of mesh points Nmesh required for the Gauss–Jacobi quadrature to be applied to a range
of test problems (see Appendix A). The values are predicted using (3.12), with ENmesh set as machine
epsilon eps
(a, b, z) (1, 3, 10) (8.1, 10.1, 100) (1, 2, 600) (10−3 , 1, 700) (4, 8, 200)
epsilon eps for a range of test problems. We highlight that the value of a does not
affect the predicted values, as this parameter does not appear in the inequality (3.12).
Gauss–Jacobi quadrature is a natural choice because of the form of the integrand
in (3.11) and the fact that the integrand blows up at the end points of the integral.
To implement Gauss–Jacobi quadrature, we use the Golub–Welsch algorithm [38],
though of course other methods are possible (e.g., the Glaser–Liu–Rokhlin algorithm
[36] or the Hale–Townsend algorithm [39]). As illustrated in Table 9, we find that
using Gauss–Jacobi quadrature is effective for a large range of values of |z|, provided
z does not have an imaginary part with magnitude greater than roughly 100. Addi-
tionally, a problem arises when either a or b becomes fairly large. A problem also
occurs if |z| is large, as the integral under consideration is then highly oscillatory
and/or stiff.
For small values of a and b (up to about 30–40), the method of Gauss–Jacobi
quadrature is extremely useful for evaluating the confluent hypergeometric function
when b > a > 0, as the methods that we described in previous sections are not
always reliable in this parameter regime. Due to the computational expense of run-
ning the algorithm, which is greater than the cost of implementing many of the series
expansion methods discussed previously, we only recommend a quadrature approach
in parameter regimes where series methods are likely to struggle—for example, in
regimes involving large values of |z|.
from which M can be computed. We denote these recurrence relationships using the
standard notation (+0), (0+), and (++) [33, 88]. The + indicates which parameters
(a, b, or both) have increasing real part. A naı̈ve way of using these relation-
ships is via direct application. However, for certain parameter regimes, it is instead
appropriate to utilize the theory of minimal solutions of a recurrence relationship.
A solution fn of a recurrence relation
yn+1 + bn yn + an yn−1 = 0 (3.14)
is said to be a minimal solution if there exists a linearly independent solution gn
(called a dominant solution) such that
fn
lim = 0.
n→∞ gn
We use the following theorem, discussed in [33, 34, 88], in our subsequent investiga-
tion of recurrence relations.
The solutions to the recursion relations (3.15) and their ratios as n → +∞ (for
real z) become [34]
fn √
fn = (1 + a + n − b)U (a + n; b; z) , gn = M(a + n; b; z) , ∼ e−4 nz , (3.15)
gn
fn gn+1 n
fn = (b + n − a)M(a; b + n; z) , gn = U (a; b + n; z) , ∼ 1, ∼ ,
fn−1 gn z
f n 1 g n 1
fn = M(a + n; b + n; z) , gn = (−1)n U (a + n; b + n; z) , ∼ , ∼− .
fn−1 n gn−1 z
Numer Algor
Using (3.15), the definition of a minimal solution, and Poincaré’s Theorem, one can
deduce that the minimal solutions of the relations (+0), (0+), and (++) are, respec-
tively, (1+a +n−b)U (a +n; b; z) , (b +n−a)M(a; b +n; z), and M(a +n; b +
n; z). When applying the (+0) recursion, however, the solution is only minimal in
C\R [88], making this a less convenient approach in the large-|a| case.
Suppose that we seek a solution of the three-term recurrence relation (3.14). One
method to compute numerical approximations of fn (with n= 0, ..., k) for a minimal
solution fn (if the recurrence admits such a solution3 ) is to apply Miller’s algorithm
[34]. The solution ffNk satisfies the following system:
⎛ ⎞⎛ ⎞ ⎛ ⎞
a1 b1 1 f0 /fN 0
⎜ a 2 b2 1 ⎟ ⎜ f1 /fN ⎟ ⎜ 0 ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ .. .. .. ⎟ ⎜ .. ⎟ ⎜ .. ⎟
⎜ . . . ⎟⎜ . ⎟ ⎜ . ⎟
⎜ ⎟⎜ ⎟=⎜ ⎟.
⎜ ⎟ ⎜
aN−1 bN−1 1 ⎟ ⎜ fN−1 /fN ⎟ ⎜ ⎟ ⎜ 0 ⎟
⎜ ⎟
⎝ 1 0 ⎠ ⎝ 1 ⎠ ⎝ 1 ⎠
1 fN+1 /fN fN+1 /fN
Miller’s algorithm involves observing that fN+1 /fN → 0 as N → ∞. Thus, we
can approximate fk /fN by ykN , which solves
⎛ ⎞⎛ N ⎞ ⎛ ⎞
a 1 b1 1 y0 0
⎜ a b 1 ⎟ ⎜ y N ⎟ ⎜0⎟
⎜ 2 2 ⎟⎜ 1 ⎟ ⎜ ⎟
⎜ .. .. .. ⎟ ⎜ .. ⎟ ⎜ .. ⎟
⎜ . . . ⎟⎜ . ⎟ ⎜ . ⎟
⎜ ⎟⎜ N ⎟ = ⎜ ⎟.
⎜ aN−1 bN−1 1 ⎟ ⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ yN−1 ⎟ ⎜ 0 ⎟
⎝ 1 0 ⎠ ⎝ yN N ⎠ ⎝1⎠
1 N
yN+1 0
f0 N
We thereby obtain the approximation fk ≈ y . The issue is choosing N so
y0N k
that this approximation is within a given tolerance. The standard procedure is to con-
tinually increase N until the desired fk has changed less than a prescribed tolerance.
That is, we want to verify
f f0 N
0 N+1
N+1 yk − N yk < tol.
y y0
0
As discussed in [34], an important consideration when applying this method in
cases where y0N could become 0 (or when it is difficult to compute) is that of nor-
malizing conditions. In more detail, a normalizing condition can be taken as a linear
sum of minimal solutions fn (when known); an equivalent sum can then be com-
puted for the numerically generated functions, which are truncated appropriately
based on the accuracy required. The two computed sums are then compared to fix the
normalization.
Another method for the computation of the minimal solution of (3.14) is to apply
Olver’s algorithm [75, 107], which avoids the issue of choosing N. Olver’s algorithm
treats the recurrence relationship as a two-point boundary value problem: for any N,
the minimal solution satisfies
⎛ ⎞⎛ ⎞ ⎛ ⎞
1 f0 1
⎜ a1 b1 1 ⎟ ⎜ f1 ⎟ ⎜ 0 ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ a 2 b2 1 ⎟ ⎜ f2 ⎟ ⎜ 0 ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ .. .. .. ⎟ ⎜ .. ⎟ = ⎜ .. ⎟,
⎜ . . . ⎟ ⎜ ⎟ ⎜ ⎟
⎜ ⎟⎜ . ⎟ ⎜ . ⎟
⎝ aN−1 bN−1 1 ⎠ ⎝ fN−1 ⎠ ⎝ 0 ⎠
1 fN fN
Now consider solving this linear system (ignoring for now that we do not know
fN ) using Gaussian elimination. The key observation is that forward elimination
(without pivoting) is independent of N, so we can perform it adaptively, and we only
perform back substitution when a convergence criterion is satisfied. This convergence
criterion can be tested in O(1) operations without performing the back substitution.
Explicitly, define recursively
⎛ ⎞⎛ ⎞ ⎛ ⎞
1 f0 1
⎜ p2 −p1 ⎟⎜ ⎟ ⎜
f1 ⎟ r1
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ p3 −p2 ⎟⎜ ⎟ ⎜
f2 ⎟ r2
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ .. .. ⎟⎜ ⎟ ⎜
.. ⎟ ..
⎜ . . ⎟⎜ ⎟ ⎜
. ⎟ .
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ pN−1 −pN−2 ⎟ ⎜ fN−1 ⎟ = ⎜ rN−1 ⎟ .
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ pN −pN−1 ⎟ ⎜ fN ⎟ ⎜ rN ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ pN+1 −pN ⎟ ⎜ fN+1 ⎟ ⎜ rN+1 ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ aN+2 bN+2 1 ⎟ ⎜ fN+2 ⎟ ⎜ 0 ⎟
⎝ ⎠⎝ ⎠ ⎝ ⎠
.. .. .. .. ..
. . . . .
Note that this is a slight variant of forward elimination that introduces a 0 in the kth
column of the matrix by multiplying the (k + 1)th row of the system by −pk and then
adding ak times the kth row to the (k + 1)th row.
Numer Algor
For any fixed N, we can truncate the system so it becomes upper triangular:
⎛ ⎞⎛ N ⎞ ⎛ ⎞
1 f1 1
⎜ p2 −p1 ⎟ ⎜ f N ⎟ ⎜ r2 ⎟
⎜ ⎟ ⎜ 2N ⎟ ⎜ ⎟
⎜ p3 −p2 ⎟ ⎜ f ⎟ ⎜ r3 ⎟
⎜ ⎟⎜ 3 ⎟ ⎜ ⎟
⎜ .. .. ⎟ ⎜ .. ⎟ = ⎜ .. ⎟ ,
⎜ . . ⎟ ⎜ ⎟ ⎜ ⎟
⎜ ⎟⎜ . ⎟ ⎜ . ⎟
⎝ pN−1 −pN−2 ⎠ ⎝ N
fN−1 ⎠ ⎝ rN−1 ⎠
pN fNN rN
This takes only O(1) operations to determine, whereas back substitution takes O(N)
operations.
3.6.3 Discussion
Many other methods have been developed to compute M(a; b; z) and 1 F1 (a; b; z).
We mention several of them in passing; see Ref. [80] for additional details. Reference
[63] gave two additional series expansions for 1 F1 (a; b; z); one expansion is in terms
of beta random variables, and the other is in terms of the (lower) incomplete gamma
function. Reference [51] gave an asymptotic expansion for large |b| and |z|, and Ref.
[68] includes the derivation of a second hyperasymptotic expansion. The integral rep-
resentation (3.11) can also be computed using other methods. For instance, Ref. [66]
described how to use a contour integral method to evaluate M(a; b; z), and Refs. [86,
101, 105, 106] implemented a Talbot contour integral method that can also be applied
to this problem. Furthermore, U (a; b; z) can be computed using a trapezoidal-rule
method [4].
Additional techniques for computing confluent hypergeometric functions include
Padé or rational approximations [54, 55, 58, 83], continued-fraction expansion [114]
(techniques for solving such expressions are described in Ref. [3]), a Chebyshev
expansion for 1 F1 [58], and other expressions in terms of Bessel functions [56].
Numer Algor
We note that considerable research has investigated how to compute the Whittaker
function, which is closely related to the confluent hypergeometric function. Tech-
niques from such inquiries can perhaps be adapted for the computation of M. Details
of methods for computing the Whittaker function can be found in Refs. [7, 17, 50,
67, 73, 76, 78, 110].
The methods that we have examined and implemented4 for the computation of
M(a; b; z) include the series methods in Sections 3.2, 3.3, and 3.4; the use of quadra-
ture in Section 3.5; recurrence relations in Section 3.6; and various methods that are
described in Section 3.7.
The series methods seemed to generate the most accurate results, and they have
very fast computation times in comparison to the inbuilt M ATLAB function hyper-
geom. Additionally, for values of |a| and |z| less than about 50 and |b| 1, the Taylor
series methods described in Section 3.2 and the method of expressing 1 F1 as a single
fraction in Section 3.2.1 seem typically to be sufficiently robust (with the restriction
for the single-fraction method that |b| 1). The method of Gauss–Jacobi quadrature
is also effective for “moderate” values of |a|, |b|, and |z|.
One parameter regime in which the Taylor series and single-fraction methods both
fail when one might expect them to succeed is when |a| and |z| are between roughly
10 and 60 with real parts of opposite signs (the problem arises from cancellation). In
this case, the method involving Buchholz polynomials discussed in Section 3.3 can
be very useful. One can do effective computations for large |z| (another important
case) by applying the asymptotic expansions of Section 3.4. In Section 3.4, we also
mentioned hyperasymptotics, which have exponentially improved accuracy. Their
use can provide a viable alternative for the computation of M for large |z| when soft-
ware with high precision and programs to compute the incomplete gamma function
in the entire complex plane are available [74, 77].
If |Re(a)| 50 or |Re(b)| 50, one can use the recurrence relations that we
detailed in Section 3.6 to compute hypergeometric functions with parameter values
that have real parts of smaller absolute value. One then completes the computation in
this new parameter regime using one of the methods discussed above.
When the parameters and the variable are all real, the main problem that one
faces is cancellation. For example, when computing a series representation of 1 F1
(or M) in which positive and negative terms alternate, we find that the result-
ing error properties are likely to be poor. For instance, consider the computation
of 1 F1 (50; 20; −100) or M(50; 20; −100). The sum of all of the positive Taylor
series terms for 1 F1 (50; 20; −100) is the same as the absolute value of the sum of
all of the negative terms (roughly 1.7 × 1062 ) to 16 digits, whereas the value of
−40 . This problem can be circumvented by
1 F1 (50; 20; −100) is roughly 1.4 × 10
applying forward recurrences so that the values of b in the eventual direct computa-
tion of M are (positive and) large enough that the terms cancelling each other now
have smaller magnitudes. We have thereby devised an effective strategy for com-
puting M for real parameters and variables. We use the result (3.2) and show our
aggregate strategy in Table 3.
Extending the parameters and the variable into the complex plane makes the
problem of computing the confluent hypergeometric function much more compli-
cated. We summarize our recommendations in Fig. 4, which shows which parameter
and variable values are appropriate for each of the methods that we have dis-
cussed. Details of other software for the computation of the confluent hypergeometric
function are discussed in Refs. [23, 41, 53, 61, 62, 96].
Table 3 Recommendations for which methods to use for computing the confluent hypergeometric
function when the parameters and the variable are real
Fig. 4 Summary of recommended methods for computing M for different regions of a, b, and z. (The
“etc.” in the upper right signifies that one can also use other methods from Section 3.7)
4.1 Properties of F
As discussed in Ref. [73], one constructs a branch cut between z = 1 and z = +∞.
The branch in the sector |arg(1 − z)| < π is considered to be the principle branch,
and we aim to compute F in this branch.
As was the case with the confluent hypergeometric function, the Gauss hypergeo-
metric function arises in a wide range of applications. For instance, F can be used to
describe transonic adiabatic flow over a smooth bump in an ideal compressible fluid
[13]. It has also appeared in investigations of a plasma dispersion function [59], pen-
etration by electrons of a potential barrier [18], the density of infected nodes in the
susceptible–infected–susceptible (SIS) epidemic model on networks [79], scintilla-
tion indices of beams [19, 48], stochastic dynamical systems [103], electroosmosis
of non-Newtonian fluids [109], and more.
C0 = 1 , S0 = C 0 ,
(a + j )(b + j ) z
Cj +1 = Cj , Sj +1 = Sj + Cj +1 , j = 0, 1, 2, . . . ,
c+j j +1
where Cj denotes the (j + 1)th term of the Taylor series (2.2) and Sj denotes the
sum of the first j + 1 terms.
|C |
We stop the summation either when |SNN+1| < tol for some tol and some N
or when two successive terms are small compared to SN . We then return SN as the
solution.
Method (b) As with the recommended method of Ref. [63] for computing 1 F1
that we discussed in Section 3.2, one can compute a recurrence relation for an
approximation of the Gauss hypergeometric function in terms of the two previous
approximations in an iterative scheme:
ab
S−1 = S0 = 1 , S1 = 1 + z,
c
(a + j − 1)(b + j − 1)
rj = , Sj = Sj −1 + (Sj −1 − Sj −2 )rj z, j = 2, 3, . . . .
j (c + j − 1)
Numer Algor
|S −SN |
We stop the summation either when N +1 |SN | < tol for some tol and some N or
when two or more successive terms are small. We then return SN as the solution. For
our numerical tests, we use the second of these stopping criteria.
Methods (a) and (b) both amount to truncating the series
∞
(a)j (b)j zj
S∞ = . (4.2)
(c)j j !
j =0
By using one of these two methods to compute F (a, b; c; z), we can subsequently
compute F(a, b; c; z) using the expression F (a, b; c; z) = (c)F(a, b; c; z). The
exception to this is when c ∈ Z− ∪{0}, in which case more care must be taken (which
we saw is also the case for the confluent hypergeometric function).
As shown in Table 10, Methods (a) and (b) have similar levels of effectiveness
in terms of accuracy and number of terms required for computation. Both methods
work very successfully when the parameter values have small magnitudes (especially
when |a|, |b|, |c| ≤ 20), and the time that it takes for the computation is significantly
shorter than that taken by the inbuilt M ATLAB program. Furthermore, when c is rela-
tively large in magnitude compared to a, b, and z, we observe excellent convergence
properties for both Taylor series methods, as (4.1) can be viewed as an asymptotic
expansion in this parameter regime. However, computing F (before the stopping cri-
terion is met) with Taylor series requires more terms than was the case for computing
M. In Fig. 5, we show the number of points required for the computation of three test
cases with real z ∈ [−1, 1]. As one can see, this illustrates that many more points are
required for the computation as z approaches the unit circle.
We can compute 2 F1 very accurately for a range of cases with large real parameter
values (with c < a < 0 and c < b < 0). However, the Taylor series methods are
much less effective when either |a| or |b| is much greater than |c|. For such cases,
500
Number of terms computed
400
300
200
100
0
−1 −0.5 0 0.5 1
z
Fig. 5 (Color online) Number of terms that need to be computed using the Taylor series Method (a) for
evaluating 2 F1 (and hence F) for real z ∈ [−0.95, 0.95] when a = 1.5, b = 1 + 2i, c = 4.5 + 5i (red,
dashed), a = 0.15, b = 0.2, c = 1.1 (green, solid), and a = 3, b = 2, c = 6.5 (blue, dotted) before the
stopping criterion (two successive small terms) is satisfied. The method gives results to 14-digit accuracy
Numer Algor
one should employ the recurrence relations that we will discuss in Section 4.6.1. We
conclude that the region in which the Taylor series methods seem to be effective is
|z| 0.9, provided the values of a, b, and c do not result in cancellation.
Other series expressions for 2 F1 are√
also available. For example, Ref. [82] dis-
cussed an expansion in terms of ! z := √1−z−1 . This expansion converges for |!z| < 1,
1−z+1
which is a less restrictive condition than the convergence criterion for (4.1).
As with the confluent hypergeometric function, we can compute the Gauss hyper-
geometric function by representing it as a single fraction. We now examine the
accuracy and robustness of this approach and indicate parameter regimes for which
it is particularly effective.
Method (c) As we discussed for the confluent hypergeometric function in Section
3.2.1, one can express 2 F1 (a, b; c; z) as a single fraction using recurrence relations.
One starts with α0 = 0, β0 = 1, γ0 = 1, and S0 = 1, and the recurrence relation is
given by
αj = (αj −1 + βj −1 )j (c + j − 1) ,
βj = βj −1 (a + j − 1)(b + j − 1)z ,
γj = γj −1 j (c + j − 1) ,
αj + βj
Sj = , j = 1, 2, . . . . (4.3)
γj
This generates a sequence of approximations Sj (with j = 1, 2,...) to 2 F1 (a, b; c; z).
We can select stopping criteria in the same way as for the other Taylor series methods
discussed above.
As indicated in Table 10, this approach works well for small values of the param-
eters and variable. (As a rough guide, it is good for |a| , |b| , |c| 20, and |z| 0.9.)
In particular, this method becomes more successful for computing F as |c| becomes
smaller or c becomes closer to an integer. The reason is the same as it is for the anal-
ogous method for confluent hypergeometric functions when computing M for small
|b|, and this issue is also relevant when b is close to −m, where m ∈ Z+ ∪ {0}.
However, this method does struggle more than the Taylor series methods when
either a or b has large magnitude (greater than roughly 50) due to a greater risk of
overflow—i.e., the program is attempting to compute values that are larger than it can
handle—from the potentially large numerators and denominators in (4.3). For such
cases, a sensible approach is to divide αj , βj , and γj by the same quantity at regular
intervals. Alternatively, one can use other methods, such as the recurrence relations
that we will describe in Section 4.6.1.
In Section 3.5, we discussed quadrature methods for computing M(a; b; z). We now
apply the method of Gauss–Jacobi quadrature to compute F(a, b; c; z) for real b and
c when c > b > 0 and |arg(1 − z)| < π. In this parameter and variable regime, the
Numer Algor
1
−a
1 z 1
F(a, b; c; z) = 1 − − zt (1 −
t)c−b−1 (1 +
t)b−1 d
t
2c−1 (b)(c − b) −1 2 2
⎡N ⎤
mesh 1
−a
1 ⎣ z
= wjGJ 1− − ztjGJ + EN (a; b; z)⎦ ,
(b)(c − b) 2 2 mesh
j =1
where tjGJ and wjGJ are (respectively) the Gauss–Jacobi nodes and weights on
[−1, 1] and Nmesh is the number of mesh points. Error bounds for this method are
discussed in Ref. [26].
If a is real and c > a > 0, then switching the parameters a and b in the definition
of F(a, b; c; z) allows one to apply the method of Gauss–Jacobi quadrature. As with
M, the integrand in (4.4) blows up at the end points of the integral. This motivates the
choice of Gauss–Jacobi quadrature to perform the required integration numerically.
The results in Table 10 illustrate that applying Gauss–Jacobi quadrature to the
integral in (4.4) is a useful method for computing the Gauss hypergeometric function
when c > b > 0. If the moduli of the parameters a, b, and c are at least 50–100, then
Gauss–Jacobi quadrature often performs better than Taylor series approaches. The
method also works well near the points z = e±iπ/3 , which are notoriously difficult to
compute (see the discussions in Sections 4.4 and 4.5), especially for smaller values
of |a| and |b|.
Therefore, as with 1 F1 (see Section 3.5), applying Gauss–Jacobi quadrature to
compute 2 F1 is potentially a useful method when the parameters a, b, and c have
moduli that are not too large. However, due to the relatively high computational cost
of running this algorithm in comparison to many of the series expansion methods pre-
viously outlined, we only recommend this approach for parameter regimes in which
a series method is likely to generate inaccurate solutions.
The methods that we have discussed thus far are generally very useful for computing
F for |z| 0.9. In this section, we discuss how to use these computations to compute
F effectively for any z ∈ C. This can be done either by applying transformation
5 The integral representation (4.4) is valid in the more general parameter regime Re(c) > Re(b) > 0;
formulas to the results from previous sections or by using expansions derived for the
special cases b − a ∈ Z and c − a − b ∈ Z.
Because the series (2.2) converges only for |z| < 1, and because it converges more
rapidly as |z| becomes smaller, it is important to use transformation formulas that
reduce the problem of computing (2.2) for a value of |z| near or greater than 1 to a
problem of computing the series for a new variable w with a much smaller magnitude.
We describe such transformation formulas in this section.
The idea of these transformations is to map as large a region of the complex plane
as possible onto disks |w| ≤ ρ for a number ρ ∈ (0, 1] that is as close to 0 as
possible. This is desirable because the function F can be computed faster and more
accurately when |z| is near 0. Finding representations of F that make it possible to
carry out the computation in terms of the new variable w allows one to obtain more
accurate results than by using the methods that we described previously. We show
such transformation formulas for real z in Table 4. These transformations map any
z ∈ R to a new variable w ∈ [0, 12 ].
3
6
2
4
1 2
Im(z)
Im(z)
0 0
−1 −2
−4
−2
−6
−3
−2 0 2 4 −5 0 5
Re(z) Re(z)
Fig. 6 (Color online) The curves |z| = ρ (dark blue, solid, left inner), 1z = ρ (black, dotted, left middle),
1 z
|1 − z| = ρ (red, solid, right inner), 1−z = ρ (purple, dotted, right middle), z−1 = ρ (sky blue,
1
dashed, left outer), and 1 − z = ρ (green, dashed, right outer) for (left panel) ρ = 0.6 and (right panel)
ρ = 0.8. We show the points z = e±iπ/3 using black dots. (These figures are adapted from plots in Refs.
[28, 34])
Numer Algor
(1 − z)−b 1
− F b, c − a; b − a + 1; ,
(a)(c − b) 1−z
z
F(a, b; c; z) = (1 − z)−a F a, c − b; c; , (4.6)
z−1
sin(π [c − a − b]) 1
F(a, b; c; z) = F(a, b; a + b − c + 1; 1 − z) (4.7)
π (c − a)(c − b)
(1 − z)c−a−b
− F(c − a, c − b; c − a − b + 1; 1 − z) ,
(a)(b)
za−c (1 − z)c−a−b 1
− F c − a, 1 − a; c − a − b + 1; 1 − ,
(a)(b) z
−a
(−z)−b 1
− F b − c + 1, b; b − a + 1; ,
(a)(c − b) z
where formulas (4.6)–(4.8) require that |arg(1 − z)| < π , formulas (4.7)–(4.8) addi-
tionally require that |arg z| < π , and formulas (4.5) and (4.9) require that |arg(−z)| <
π.
We tested formulas (4.5)–(4.9) on a large range of parameter and variable values
and found that they successfully compute F for variable values close to the unit disk
or with modulus greater than 1 in terms of new variables with smaller magnitude,
provided z is not too close to e±iπ/3 . However, due to the presence of (a − b),
(b − a), (c − a − b), and (a + b − c) factors in (4.5)–(4.9), the cases b − a ∈ Z
and c − a − b ∈ Z cannot be handled by applying the transformations in Table 4,
when computing 2 F1 . There are also numerical issues when either b − a or c − a − b
is close to an integer, as two large conflicting terms are being added together (leading
to cancellation).
References [3, 20] discussed formulas that avoid the above cancellation issue when
either b − a or c − a − b is exactly equal to an integer. These cases can be computed
Numer Algor
using the ideas detailed in Section 3.2. Reference [23] derived expressions for b − a
or c−a −b close to an integer using a polynomial expansion for the Gamma function.
Reference [61] showed how to exploit the Lanczos expansion and other properties of
the Gamma function for successful computation when b − a or c − a − b is close to
an integer.
Applying the transformation formulas of Section 4.4 becomes √ a much less viable
method as z approaches the points z = e±iπ/3 = 12 (1 ± i 3). The reason is as
follows: whatever value ρ ∈ (0, 1] is taken for |z| ≤ ρ, it is not possible to map
the points z = e±iπ/3 onto a w in a disk of radius less than 1, as points are mapped
to themselves or each other under any of the six transformations in Table 4. As ρ
increases towards 1, an increasingly large number of points close to z = e±iπ/3 are
mapped into such a disk, but the points themselves can never be mapped into a disk,
and points very close to them require a computation that involves a prohibitively large
value of ρ (for which the methods discussed thus far do not generate an accurate
result).
To resolve this issue, Refs. [11, 12] gave an expansion in the form of a continuation
formula:
∞
(b − a)
F(a, b; c; z) = (z0 − z)−a dj (a, z0 )(z − z0 )−j (4.10)
(b)(c − a)
j =0
∞
(a − b) −b
+ (z0 − z) dj (b, z0 )(z − z0 )−j ,
(a)(c − b)
j =0
where |arg(z0 − z)| < π , the difference b − a is not an integer, and dj is defined by
where
d ab
q0 = 2 F1 (a, b; c; z0 ) , q1 =
[2 F1 (a, b; c; z0 )] = 2F1 (a + 1, b + 1; c + 1; z0 ) ,
dz0 c
$ %
1 (a + n)(b + n)
qn+2 = n(2z0 − 1) − c + (a + b + 1)z0 qn+1 + qn ,
z0 (1 − z0 )(n + 2) n+1
for n = 0, 1, 2, . . . . One can also use these relations to compute the func-
tion F(a, b; c; z). The quantities q0 and q1 should be calculated using a method
appropriate for the parameter regimes in question. As in Ref. [61], we take
&
z 0.9, if |z| ≤ 1 ,
z0 = r0 , r0 =
|z| 1.1, if |z| > 1 .
The method is more convenient than the one in Ref. [11] because there are no
Gamma functions in the above expression for 2 F1 , so no singularities arise when
b − a ∈ Z or c − a − b ∈ Z. As discussed in Ref. [61], this method gives better
accuracy for large |a| and |b|. However, the method can be slow computationally due
to the work of computing q0 and q1 .
4.6 Techniques for large values of the parameters |a|, |b|, and |c|
In this section, we detail two widely researched techniques that can be useful for
evaluating F when |a|, |b|, and |c| are sufficiently large that the function cannot be
evaluated effectively using methods that we described previously. The two methods
that we now discuss entail the use of recurrence relations—involving computing F
for “nicer” parameter values and applying the recurrence relations to obtain a solution
for more awkward values—or uniform asymptotics, which involves computing series
for F in terms of other special functions.
Numer Algor
Table 5 Minimal solutions of the four recurrence relations for F for z in different regions of the complex
plane. See the discussion in Ref. [33]
(+ + 0), C\{z ≤ 0} (1+a −c +n)(1+b −c +n)F(a +n, b +n; 1+a +b −c +2n; 1−z)
n
(00+), Re(z) > 1
2
z−1
z (c + n)F(1 − a, 1 − b; 1 − a − b + c + n; 1 − z)
n
(b−c+1+2n)(a−c+1+2n)
(+ + −) z
(z−1)3 (a+n)(b+n)(1−c+n) F(1 − a − n, 1 − b − n; 2 − c + n; z)
Inside curve in Fig. 7 (left)
(b−c+1+2n)(a−c+1+2n)
(+ + −) (1−c+n) F(a + n, b + n; 1 + a + b − c + 3n; 1 − z)
Outside curve in Fig. 7 (left)
n
−z (b−c+1+n)(a−c+1+2n)
(+0−) (1−z)2 (a+n)(1−c+n) F(1 − a − n, 1 − b; 2 − c + n; z)
Inside inner curve in Fig. 7 (right)
(b−c+1+n)(a−c+1+2n)
(+0−) (1−c+n) F(a + n, b; 1 + a + b − c + 2n; 1 − z)
Between curves in Fig. 7 (right)
n
−z (1+a−c+2n)
(+0−) (1−z)2 (1−c+n) F(1 − b, −b + c − n; 1 + a − b + n; 1z )
Outside curves in Fig. 7 (right)
Numer Algor
Im
4
Im 2
0.06
0.04
Re
1 1 2 3 4 5
0.02
Re
0.15 0.10 0.05 0.00 0.05 2
0.02
0.04
0.06 4
Fig. 7 Relevant regions for minimal solutions of recurrence relations (left) (+ + −) and (right) (+0−).
With reference to Table 5, in the left plot, “Inside curve” refers to the enclosed region and “Outside curve”
refers to the remainder of C; in the right plot, “Inside inner curve” refers to the smaller enclosed region,
“Between curves” refers to the larger enclosed region, and “Outside curves” refers to the remainder of C
solutions in different regions of the complex plane. We give the minimal solutions as
n → +∞ for each of the four recurrence relations [33] in Table 5.
Therefore, as with M in Section 3.6, we apply two different methods. First, we
take the minimal solutions of the four recurrence relations in specific regions and
apply the recurrence relations backwards. Second, we use the minimal solutions of
the recurrence relations to apply the recurrence relations using Miller’s algorithm
or Olver’s algorithm. A viable way of computing a hypergeometric function with
parameters whose real parts have large moduli is therefore to compute two hyperge-
ometric functions whose real parts have smaller moduli and then apply appropriate
recurrence relations.
Another potentially viable method for dealing with large values of the parame-
ters |a|, |b|, and |c| when computing F(a, b; c; z) is to exploit uniform asymptotic
expansions. In particular, the following three uniform asymptotic expansions are
useful:
• Expansion for F a + λ, b − λ; c; 12 − 12 z as λ → ∞ [44]: For fixed a, b, c ∈
C and | arg z| < π [44] (see also [16]),
1 1 1 1 1
F a + λ, b − λ; c; − z ∼ 2 2 (a+b−1) (z − 1)− 2 c (z + 1) 2 (c−a−b−1)
2 2
∞
sinh ζ 1/2 Ic−1+m (αζ )
× Cm (ζ )ζ ,
ζ α m+c−1
m=0
Numer Algor
as |λ| → ∞, where Iν (z) = i −ν Jν (iz) and Jν (z) is the Bessel function (see
Appendix C). Additionally, z = cosh ζ , α = 12 (a − b) + λ, and Cj (ζ ) is defined
by C0 (ζ ) = 1 and
Cm (ζ ) Cm (ζ )
Cm (ζ )+{1−2(ν+m)} +{m(m+2ν)} +2Cm+1 (ζ ) = ψ(ζ )Cm (ζ ) ,
ζ ζ2
where m = 0, 1, 2, . . ., the parameter ν = c − 1, and
3 1 1 c1 − 12 c3
ψ(ζ ) = + 4c1 − + ,
4 sinh2 ζ ζ2 cosh2 21 ζ
1' ( 1
c1 = (c − 1)2 − 1 , c3 = {(a + b − c)2 − 1} .
4 2
• Expansion for 2 F1 (a, b − λ; c + λ; −z) as λ → ∞ [69]: For fixed a, b, c ∈ C
and | arg z| < π ,
where τc = 2(z+1)
z−1
. The τ -contour is a simple loop encircling the points 0 and τc ,
and, for each τ on this contour, the u-contour is a small loop encircling the point
u(τ ), where 12 u2 = −ln(1 − 4τ 2 ).
• Expansion for 2 F1 (a + λ, b + 2λ; c; −z) as λ → ∞ [70]: For fixed a, b, c ∈ C
and | arg z| < π ,
3 (c)(1 − c + b + 2λ)
2 F1 (a + λ, b + 2λ; c; −z) = (1 + z)− 2 λ
(b + 2λ)
$ 1
a−c+λ+ 3 πi
− a−c+λ+ 13 πi
%
× e Ai (e−πi λ)2/3 x + e Ai (eπi λ)2/3 x χ1
$ %
a−c+λ+ 23 πi − a−c+λ+ 23 πi
− e Ai (e−πi λ)2/3 x + e Ai (eπi λ)2/3 x χ0 ,
where
∞
∞
1 2
χ1 ∼ (−1)s γ1,s λ−s− 3 , χ0 ∼ (−1)s γ0,s λ−s− 3 ,
s=0 s=0
as λ → ∞ in | arg λ| ≤ π2 − δ < π2 . Recall that Ai(z) is the Airy function (see
Appendix C). In the above equations, x is defined such that 43 x 3/2 = −2ζ +
Numer Algor
2+eζ
−ζ , where ζ = arccosh 4 z − 1 ; this implies that z > 8 ⇔ ζ >
1
3 log 2+e
0 ⇔ x > 0. Additionally, the coefficients γj,s are given (for j = 0, 1) by
) )
(−1)s s! t c−b−1 (t − 1)a−c (z + 1 − t)−a uj
γj,s = s+1 dudt ,
(2π i)2 {sp± } {u(t)} 1 3
3 u − xu + γ − ln t−1
t 2 (z+1−t)
where γ = − 32 ln(z + 1). The t-contour is a simple loop encircling the saddle
points sp± := 2 + e±ζ , and, for each t on this contour, the
u-contour is a small
loop encircling the point u(t), where 13 u3 = ln t−1
t 2 (z+1−t)
+ xu − γ [70].
Several other methods have been documented for the computation of F(a, b; c; z)
[80]. For example, alternative methods can be used to compute the integral
representation (4.4); these include splitting the integral, Romberg integration,
and adaptive quadrature (though note that the latter two require that the inte-
grand does not blow up at on either end point of the region of integra-
tion). Other possible methods include Padé approximants [83], evaluating a
continued-fraction representation [115] using the technique described in Ref. [3],
rational approximation [55], Chebyshev expansion [56], an -expansion method
[42], exploiting alternative series expansions [52], and developing relationships
between different types of hypergeometric functions by evaluating Feynman path
integrals [47].
and analytic-continuation formulas from Sections 4.4 and 4.5 to find ways to compute
F accurately and efficiently for all z ∈ C.
We find that the series methods compute F(a, b; c; z) accurately for values of |a|
and |b| less than about 50. The single-fraction method is particularly useful when
|c| < 1 and |a| , |b| < 30. When Re(c) > Re(b) > 0 or Re(c) > Re(a) > 0, the
method based on Gauss-Jacobi quadrature is often effective. A variety of the above
methods work well if |z| 0.9.
A difficulty arises when one needs to compute values of F(a, b; c; z) outside the
unit disk {|z| = 1}. In such situations, one can apply the transformation formulas of
Section 4.4 or the methods detailed therein for the special cases satisfying b − a ∈ Z
or c − a − b ∈ Z. A further issue arises when |Re(a)|, |Re(b)|, or |Re(c)| is too large
for a method to work effectively on its own. (As a rough guide, this can occur when
any of these values exceeds 50.) In such cases, one can exploit the recurrence-relation
techniques of Section 4.6.1. Alternatively, one can employ the uniform asymptotic
expansions of Section 4.6.2 if |a|, |b|, or |c| is large.
Table 6 Recommendations for which methods to use for computation of the Gauss hypergeometric func-
tion for real parameters and a real variable z satisfying |z| < 1. For |z| ≥ 1, appropriate transformations
are also necessary (see Section 4.4)
To devise an algorithm for cases in which all of the parameters and the variable
are real, we follow the same type of procedure as for M. Namely, we apply forward
Fig. 8 Summary of recommended methods for computing F for different values of the parameters a, b,
and c and the variable z. (The “etc.” in the upper right signifies that one can also use other methods from
Section 4.7; a “large” parameter can refer either to its real part being large or to its absolute value being
large, and an analogous comment holds for the adjective “small”. See the text for details)
Numer Algor
recurrences to c so that all computations involve large values of |c| and then use an
additional transformation, such as [110, Eq. (15.8.1)]
= (1 − z)c−a−b 2 F1 (c − a, c − b; c; z)
2 F1 (a, b; c; z) (4.12)
⇔ F(a, b; c; z) = (1 − z)c−a−b F(c − a, c − b; c; z)
or the relation (4.6). We detail our strategy for the real case in Table 6.
When one extends the parameters and the variable into the complex plane, the
problem of computing the Gauss hypergeometric function becomes more compli-
cated. One can achieve good results when computing F by following the procedure
detailed in Fig. 8, which takes account of different values of |a|, |b|, |c|, and |z|.
Details of other software written to compute the Gauss hypergeometric function
can be found in Refs. [23, 41, 53, 61, 62].
5 Concluding remarks
The confluent and Gauss hypergeometric functions arise in a large and diverse set of
applications, and many other functions are special cases of them. However, both of
these hypergeometric functions are notoriously difficult to compute effectively.
In this review paper, we have briefly outlined the theory of these hypergeomet-
ric functions, and we detailed a large number of good methods for computing them
for different parameter and variable regimes. We have aimed to provide a roadmap
for computing these functions for anyone who wishes to use them in a specific
application and requires an effective implementation strategy for their evaluation.
There is no one method that provides a panacea for computing either M or F,
as there are numerous difficult computational issues (such as cancellation and over-
flow). Accordingly, we have detailed numerous good methods that should be chosen
carefully depending on the values of the parameters a and b (and also c for F), and
the variable z. We have included roadmaps for the computation of both M and F that
should be used with appropriate transformations and recurrence relations (which we
have also detailed). It is important to note that error bounds for the majority of these
methods have not been widely researched (as most of the methods involve known
series representations and hence can be calculated to arbitrary precision in infinite-
precision arithmetic), but we believe the methods that we recommend have good error
properties in the specified parameter and variable regions.
We have written and posted software for computing M(a; b; z) and F(a, b; c; z)
[116]. We find the methods that we include in the software for computing M
to be effective for |a|, |b|, |z| 100 for real parameters and variables, and for
|a|, |b|, |z| 70 for complex variables and parameters; the methods for computing
F are effective for |a|, |b|, |c| 100 and for any z if the parameters and variables
are real, and for |a|, |b|, |c| 70 and for any z if they are complex. The methods are
potent despite the fact that the code is implemented in double-precision arithmetic, in
contrast to the majority of widely used software for hypergeometric functions. There
are also other parameter and variable regimes for which our software can be applied
Numer Algor
effectively—for instance, for large |z| when computing M—and we are currently
developing the software to expand the parameter and variable regimes for which it is
effective.
Acknowledgments This research was conducted over a number of years, beginning as a project in the
University of Oxford’s MSc program in Mathematical Modelling and Scientific Computing so that the
Numerical Algorithms Group (NAG) would be able to acquire enough information on the subject of com-
putation of hypergeometric functions to achieve their goal of writing packages on the topic for the NAG
Library [113]. The routines s22ba and s22bb (for computing confluent hypergeometric functions) and
s22be and s22bf (for the Gauss hypergeometric functions) in the NAG library are based substantially
on the work in this paper and the associated MSc project. We thank the staff at NAG—especially Mick
Pont, David Sayers, and Lawrence Mulholland—for productive discussions. We also thank Andy Wathen
and Nick Trefethen for useful advice. We also thank Frank Olver for providing us with an advanced copy
of drafts of the chapters on hypergeometric functions in Ref. [110]. We are grateful to the many scientists
who have contacted us about this work and have brought new applications of hypergeometric functions to
our attention. JWP thanks the Engineering and Physical Sciences Research Council (EPSRC) and NAG
for funding. We express our gratitude to the anonymous referees for their valuable comments.
This appendix details the test cases for M and F that we use in our numerical experi-
ments in Appendix B. We show the test cases for M in Table 7 and the test cases for
F in Table 8.
In addition to using test cases such as these, other methods can also be used to test
the accuracy of our computations. For instance, one can use tabulated values from
sources such as Refs. [90, 91, 108], test against known relations to elementary or
special functions [3, 7, 57, 110], or test against known recurrence relations [3, 15, 34,
110] or Wronskians [56, 96, 110].
In this appendix, we present numerical results that indicate the number of digits of
accuracy that we obtained when using a variety of methods for computing M and F.
In Table 9, we show results that we obtained when computing M (or 1 F1 for values
of b such that (b) is infinite in finite precision) for the two Taylor series methods
of Section 3.2, the single-fraction method of Section 3.2.1, the Buchholz polyno-
mial method of Section 3.3, the two methods for computing the asymptotic series of
Section 3.4, and the Gauss–Jacobi quadrature method of Section 3.5.
In Table 10, we present results that we obtained for computing F (or 2 F1 when
c is such that (c) is infinite in finite precision) using the two Taylor series
methods of Section 4.2, the single-fraction method of Section 4.2.1, the Gauss–
Jacobi quadrature method of Section 4.3, and (in the column labeled “Bühring”) the
analytic-continuation formula (4.10) of Section 4.5.
The label “A” in Tables 9 and 10 indicates that the series method in consid-
eration did not converge after computing 500 terms. The label “B” indicates that
the method was not effective because of overflow. The label “C,” which we use
Numer Algor
Table 7 List of 40 test cases that we use to generate the results for M in Appendix B. The justification
for the selection of these cases is given in Ref. [80]
sometimes when we present a result from Gauss–Jacobi quadrature, indicates that the
test case in question is not in a valid parameter regime for the method to be applicable.
Table 8 List of 30 test cases that we use to generate the results for F in Appendix B. The justification for
the selection of these cases is given in Ref. [80]
case of M, and the Bessel function is closely related to the confluent hypergeometric
limit function 0 F1 [110].6
The inbuilt M ATLAB routines for computing special functions (as of Version
R2015a) are far from exhaustive; there only exist routines for the Gamma, Bessel,
incomplete gamma, and Airy functions; and (apart from the Airy functions) these
routines are usable only for a rather limited set of parameter and variable values.
We therefore needed to use other routines to compute these functions accurately and
efficiently for various parameter regions.
There is an inbuilt routine (gamma) for computing the Gamma function (z) in
M ATLAB, but it requires the argument z to be real. The NAG Library [113], however,
contains a routine (s14ag) to evaluate log[(z)] for any complex z, and we used
this for some of our work. If one wishes to write his/her own routine for evaluating
(z) for z ∈ C, then for various values of z, one can use the Lanczos expansion
[49] (possibly using an expansion given by Godfrey at [37]), Stirling expansions
[3], Spouge’s method [89], or a Talbot contour method [86, 101, 105, 106]. When
Re(z) < 12 and z ∈ / Z, the transformation [110, Eq. (5.5.3)]
π
(z)(1 − z) =
sin(π z)
may be helpful when using the Talbot contour method.
Table 9 Table of results for various methods described in Section 3 for computing M. We state the number
of digits of accuracy obtained by applying each method to each test case from Table 7 in Appendix A
Case Taylor (a) Taylor (b) Single fraction Buchholz Asymptotic (a) Asymptotic (b) Gauss–Jacobi
1 16 16 16 A A A 16
2 16 16 16 16 A A C
3 16 16 16 A A A 15
4 16 16 15 15 A A C
5 16 16 15 9 A A C
6 8 15 15 0 A A C
7 15 16 15 5 A A C
8 15 15 15 15 16 16 14
9 16 16 15 A A A B
10 15 16 0 13 15 15 13
11 A A 0 A 16 16 12
12 16 15 15 15 A A C
13 0 0 0 14 A A C
14 15 15 15 15 A A C
15 0 0 0 15 A A C
16 16 16 16 15 A A C
17 16 16 16 16 A A C
18 A A 0 A 16 16 13
19 0 0 0 16 A A C
20 0 0 0 15 A A C
21 6 6 6 8 A A C
22 16 16 15 8 A A C
23 5 5 5 8 A A C
24 0 0 B A A A C
25 14 14 14 15 A A C
26 15 16 0 A 15 15 0
27 14 14 14 A A A C
28 0 0 B A 14 14 C
29 14 15 15 A 14 14 C
30 A 0 A A B B C
31 A A B A 15 15 C
32 15 15 15 A 15 15 C
33 0 15 15 A A A C
34 4 15 16 12 A A C
35 4 15 15 11 A A C
36 15 15 15 0 A A C
37 A A 0 A A A C
38 A A 0 A A A C
39 A 1 A 0 A A C
40 16 16 15 A A A C
We obtained these results using M ATLAB R2015a. We note again that the label “A” indicates non-
convergence of a series method, the label “B” indicates that the method was not effective because of
overflow, and the label “C” indicates that the test case in question is not in the valid parameter regime for
the Gauss–Jacobi quadrature method
Numer Algor
M ATLAB also has an inbuilt routine to compute the Bessel function Jν (z), but it is
only applicable for real ν, so it would be useful to design a routine that can also be
used for complex ν. Such a routine could then be used for the methods in Sections
Table 10 Table of results for various methods described in Section 4 for computing F. We state the
number of digits of accuracy obtained by applying each method to each test case from Table 8 in Appendix
A
1 16 16 16 16 A
2 16 16 16 15 A
3 16 16 16 C 16
4 15 15 15 C A
5 16 16 16 C 12
6 15 15 15 C A
7 16 16 15 C A
8 14 15 A C A
9 A A A B A
10 16 16 15 16 0
11 8 8 8 C A
12 16 16 16 C A
13 0 0 0 C A
14 A A B C A
15 14 14 0 C A
16 0 0 0 C A
17 A A 0 C A
18 0 0 0 13 A
19 0 0 0 C A
20 0 0 B 6 A
21 3 3 A B A
22 16 16 16 B A
23 A A 0 C 16
24 A A A C A
25 A A 3 14 11
26 A A 5 14 11
27 16 16 16 15 16
28 A A A 14 16
29 A A A C 14
30 A A A 15 16
We obtained these results using M ATLAB R2015a. We note again that the label “A” indicates non-
convergence of a series method, the label “B” indicates that the method was not effective because of
overflow, and the label “C” indicates that the test case in question is not in the valid parameter regime for
the Gauss–Jacobi quadrature method
Numer Algor
3.3 and 4.6.2. In constructing such a code, one may wish to take advantage of its
Taylor series, Hankel asymptotic representation, and integral relations [3], as well as
work on practical computation of this function in [30]; and we exploit these tools in
our code.
The “upper” and “lower” incomplete gamma functions (a, z) and γ (a, z) can be
computed for any complex z using the inbuilt M ATLAB function gammainc, but this
routine can only be applied for real a ≥ 0. One hence needs to generalize this routine
to implement the hyperasymptotic expansions detailed in Section 3.4. To do this, one
can exploit Taylor series methods [83], asymptotic expansions [3], continued-fraction
representations [83], recurrence relations [3], and the relation [110, Eq. (8.2.3)]
In this appendix, we state the recurrence relations for 2 F1 that we denoted in Section
4.6.1 as (++0), (00+), (++−), and (+0−). In addition to the relations themselves,
we also indicate their minimal solutions (see Table 5) that inspire these notations. We
discussed their regions of validity in Section 4.6.1. The recurrence relations and their
solutions are as follows:
References
1. Abad, J., Sesma, J.: Buchholz polynomials: A family of polynomials relating solutions of confluent
hypergeometric and Bessel equations. J. Comput. Appl. Math. 101, 237–241 (1999)
2. Abad, J., Sesma, J.: Computation of the regular confluent hypergeometric function. The Mathematica
Journal 5, 74–76 (1995)
3. Abramowitz, M., Stegun, I. (eds.): Handbook of Mathematical Functions with Formulas, Graphs,
and Mathematical Tables. National Bureau of Standards (1970)
4. Allasia, G., Besenghi, R.: Numerical computation of Tricomi’s psi function by the trapezoidal rule.
Computing 39, 271–279 (1987)
5. Ancarani, L.U., Gasaneo, G.: Derivatives of any order of the confluent hypergeometric function
1 F1 (a, b, z) with respect to the parameter a or b. J. Math. Phys. 49 (2008)
6. Andrews, G.E., Askey, R., Roy, R.: Special Functions, vol. 71 of Mathematics and its Applications.
Cambridge University Press (1999)
7. Badralexe, R., Marksteiner, P., Oh, Y., Freeman, A.J.: Computation of the Kummer functions and
Whittaker functions by using Neumann type series expansions. Comput. Phys. Commun. 71, 47–55
(1992)
8. Bell, K.L., Scott, N.S.: Coulomb functions (negative energies). Comput. Phys. Commun. 20, 447–
458 (1980)
9. Berry, M.V.: Asymptotics, superasymptotics, hyperasymptotics... In: Asymptotics Beyond All
Orders, ed. H. Segur, S. Tanveer (Plenum, New York, 1991), pp. 1–14 (1992)
10. Boyle, P., Potapchik, A.: Application of high-precision computing for pricing arithmetic Asian
options, pp. 39–46. International Conference on Symbolic and Algebraic Computation (2006)
11. Bühring, W.: An analytic continuation of the hypergeometric series. SIAM J. Math. Anal. 18, 884–
889 (1987)
12. Bühring, W.: An analytic continuation formula for the generalized hypergeometric function. SIAM
J. Math. Anal. 19, 1249–1251 (1988)
13. Chiocchia, G., Gabutti, B.: A new transformation for computing hypergeometric series and the exact
evaluation of the transonic adiabatic flow over a smooth bump. Comput. Fluids 17, 13–23 (1989)
Numer Algor
14. Deaño, A., Segura, J.: Transitory minimal solutions of hypergeometric recursions and pseudocon-
vergence of associated continued fractions. Math. Comput. 76, 879–901 (2007)
15. Deaño, A., Temme, N.M.: On modified asymptotic series involving confluent hypergeometric
functions. Electron. Trans. Numer. Anal. 35, 88–103 (2009)
16. Dunster, T.M.: Asymptotic approximations for the Jacobi and ultraspherical polynomials, and related
functions. Methods Appl. Anal. 6, 21–56 (1999)
17. Dunster, T.M.: Uniform asymptotic expansions for Whittaker’s confluent hypergeometric function.
SIAM J. Math. Anal. 20, 744–760 (1989)
18. Eckart, C.: The penetration of a potential barrier by electrons. Phys. Rev. 35, 1303–1309
(1930)
19. Efimov, A.: Intuitive model for the scintillations of a partially coherent beam. Opt. Express 22,
32353–32360 (2014)
20. Erdélyi, A., Magnus, W., Oberhettinger, F., Tricomi, F.G.: Higher Transcendental Functions, vol. I.
McGraw–Hill (1953)
21. Eremenko, V., Upadhyay, N.J., Thompson, I.J., Elster, C.h., Nunes, F.M., Arbanas, G., Escher, J.E.,
Hlophe, L.: Coulomb wave functions in momentum space. Comput. Phys. Commun. 187, 195–203
(2015)
22. Ferreira, C., López, J.L., Sinusı́a, E.P.: The Gauss hypergeometric function F (a, b; c; z) for large c.
J. Comput. Appl. Math. 197, 568–577 (2006)
23. Forrey, R.C.: Computing the hypergeometric function. J. Comput. Phys. 137, 79–100 (1997)
24. Gautschi, W.: Computational aspects of three-term recurrence relations. SIAM Rev. 9, 24–82 (1967)
25. Gautschi, W.: A computational procedure for incomplete gamma functions. ACM Trans. Math.
Softw. 5, 466–481 (1979)
26. Gautschi, W.: Gauss quadrature approximations to hypergeometric and confluent hypergeometric
functions. J. Comput. Appl. Math. 139, 173–187 (2002)
27. Gavrila, M.: Elastic scattering of photons by a hydrogen atom. Phys. Rev. 163, 147–155 (1967)
28. Gil, A., Segura, J., Temme, N.M.: The ABC of hyper recursions. J. Comput. Appl. Math. 190, 270–
286 (2006)
29. Gil, A., Segura, J.: Algorithm 819: AIZ, BIZ: Two Fortran 77 routines for the computation of
complex Airy functions. Trans. Math. Softw. 28, 325–336 (2002)
30. Gil, A., Segura, J.: Algorithm 831: Modified Bessel functions of imaginary order and positive
argument. Trans. Math. Softw. 30, 159–164 (2004)
31. Gil, A., Segura, J., Temme, N.M.: Efficient and accurate algorithms for the computation and
inversion of the incomplete gamma function ratios. SIAM J. Sci. Comput. 34, A2965–A2981 (2012)
32. Gil, A., Segura, J., Temme, N.M.: Fast and accurate computation of the Weber parabolic cylinder
function W (a, x). IMA J. Numer. Anal. 31, 1194–1216 (2011)
33. Gil, A., Segura, J., Temme, N.M.: Numerically satisfactory solutions of hypergeometric recursions.
Math. Comput. 76, 1449–1468 (2007)
34. Gil, A., Segura, J., Temme, N.M.: Numerical Methods for Special Functions. Society for Industrial
and Applied Mathematics (2007)
35. Gil, A., Segura, J., Temme, N.M.: Parabolic cylinder function W (a, x) and its derivative. ACM
Trans. Math. Softw. 38 (2011). Article 6
36. Glaser, A., Liu, X., Rokhlin, V.: A fast algorithm for the calculation of the roots of special functions.
SIAM J. Sci. Comput. 29, 1420–1438 (2007)
37. Godfrey, P.: A note on the computation of the convergent Lanczos complex gamma approximation
(2001), available at http://www.numericana.com/answer/info/godfrey.htm
38. Golub, G.H., Welsch, J.W.: Calculation of Gauss quadrature rules. Math. Comput. 23, 221–230
(1969)
39. Hale, N., Townsend, A.: Fast and accurate computation of Gauss–Legendre and Gauss–Jacobi
quadrature nodes and weights. SIAM J. Sci. Comput. 35, A652–A674 (2013)
40. Hochstadt, H.: The Functions of Mathematical Physics. Wiley (1971)
41. Hsu, Y.P.: Development of a Gaussian hypergeometric function code in complex domains. Int. J.
Modern Phys. C 4, 805–840 (1993)
42. Huang, H.-Z., Liu, J.: NumExp: Numerical epsilon expansion of hypergeometric functions. Comput.
Phys. Commun. 184, 1973–1980 (2013)
43. Ibrahim, A.K., Rakha, M.A.: Contiguous relations and their computations for 2 F1 hypergeometric
series. Comput. Math. Appl. 56, 1918–1926 (2008)
Numer Algor
44. Jones, D.S.: Asymptotics of the hypergeometric function. Math. Methods Appl. Sci. 24, 369–389
(2001)
45. Kalla, S.L.: On the evaluation of the Gauss hypergeometric function. Compt. Rendus l’Acad. Bulgare
Sci. 45, 35–36 (1992)
46. Khwaja, F., Olde Daalhuis, A.B.: Uniform asymptotic expansions for hypergeometric functions with
large parameters IV. Anal. Appl. 12, 667–710 (2014)
47. Kniehl, B.A., Tarasov, O.V.: Finding new relationships between hypergeometric functions by
evaluating Feynman integrals. Nuclear Phys. B 854, 841–852 (2012)
48. Korotkova, O.: Scintillation index of a stochastic electromagnetic beam propagating in random
media. Opt. Commun. 281, 2342–2348 (2008)
49. Lanczos, C.J.: A precision approximation of the gamma function. SIAM J. Numer. Anal. Ser. B 1,
86–96 (1964)
50. López, J.L.: Asymptotic expansions of the Whittaker functions for large order parameter. Methods
Appl. Anal. 6, 249–256 (1999)
51. López, J.L., Pagola, P.J.: The confluent hypergeometric functions M(a, b; z) and U (a, b; z) for large
b and z. J. Comput. Appl. Math. 233, 1570–1576 (2010)
52. López, J.L., Temme, N.M.: New series expansions of the Gauss hypergeometric function. Adv.
Comput. Math. 39, 349–365 (2013)
53. Lozier, D.W., Olver, F.W.J.: Numerical evaluation of special functions. In: Mathematics of Com-
putation 1943–1993: A Half-Century of Computational Mathematics, Proceedings of Symposia in
Applied Mathematics, American Mathematical Society (1994)
54. Luke, Y.L.: Algorithms for rational approximations for a confluent hypergeometric function. Utilitas
Math. 11, 123–151 (1977)
55. Luke, Y.L.: Algorithms for the Computation of Mathematical Functions. Academic Press (1977)
56. Luke, Y.L.: Mathematical Functions and their Approximations. Academic Press (1975)
57. Luke, Y.L.: The Special Functions and their Approximations, vol. I. Academic Press (1969)
58. Luke, Y.L.: The Special Functions and their Approximations, vol. II. Academic Press (1969)
59. Mace, R.L., Hellberg, M.A.: A dispersion function for plasmas containing superthermal particles.
Phys. Plasmas 2, 2098–2109 (1995)
60. Mathar, R.J.: Numerical representations of the incomplete gamma function of complex-valued
argument. Numer. Algorithms 36, 247–264 (2004)
61. Michel, N., Stoitsov, M.V.: Fast computation of the Gauss hypergeometric function with all its
parameters complex with application to the Pöschl–Teller–Ginocchio potential wave functions.
Comput. Phys. Commun. 178, 535–551 (2008)
62. Moshier, S.L.: Methods and Programs for Mathematical Functions. Ellis Horwood (1989)
63. Muller, K.E.: Computing the confluent hypergeometric function, M(a, b, x). Numer. Math. 90, 179–
196 (2001)
64. Nardin, M., Perger, W.F., Bhalla, A.: Algorithm 707: CONHYP: A numerical evaluator of the conflu-
ent hypergeometric function for complex arguments of large magnitudes. ACM Trans. Math. Softw.
18, 345–349 (1992)
65. Nardin, M., Perger, W.F., Bhalla, A.: Numerical evaluation of the confluent hypergeomet-
ric function for complex arguments of large magnitudes. J. Comput. Appl. Math. 39, 193–
200 (1992)
66. Nieuwveldt, F.D.: A Survey of Computational Methods for Pricing Asian Options. Masters’ thesis,
University of Stellenbosch (2009). available at http://scholar.sun.ac.za/handle/10019.1/2118
67. Noble, C.J., Thompson, I.J.: COULN, a program for evaluating negative energy coulomb functions.
Comput. Phys. Commun. 33, 413–419 (1984)
68. Olde Daalhuis, A.B.: Hyperasymptotic expansions of confluent hypergeometric functions. IMA J.
Appl. Math. 49, 203–216 (1992)
69. Olde Daalhuis, A.B.: Uniform asymptotic expansions for hypergeometric functions with large
parameters I. Anal. Appl. 1, 111–120 (2003)
70. Olde Daalhuis, A.B.: Uniform asymptotic expansions for hypergeometric functions with large
parameters II. Anal. Appl. 1, 121–128 (2003)
71. Olde Daalhuis, A.B.: Uniform asymptotic expansions for hypergeometric functions with large
parameters III. Anal. Appl. 8, 199–210 (2010)
72. Olde Daalhuis, A.B., Olver, F.W.J.: Hyperasymptotic solutions of second-order linear differential
equations I. Methods Appl. Anal. 2, 173–197 (1995)
Numer Algor
73. Olver, F.W.J.: Asymptotics and Special Functions. Academic Press (1974)
74. Olver, F.W.J.: Exponentially-improved asymptotic solutions of ordinary differential equations I: the
confluent hypergeometric function. SIAM J. Math. Anal. 24, 756–767 (1993)
75. Olver, F.W.J.: Numerical solution of second order linear difference equations. J. Res. Nat. Bur. Stand.
Sect. B 71, 111–129 (1967)
76. Olver, F.W.J.: On the asymptotic solution of second-order differential equations having an irregular
singularity of rank one, with an application to Whittaker functions. J. Soc. Indust. Appl. Math. Ser.
B (Numerical Analysis) 2, 225–243 (1965)
77. Olver, F.W.J.: Uniform, exponentially improved, asymptotic expansions for the confluent hypergeo-
metric function and other integral transforms. SIAM J. Math. Anal. 22, 1475–1489 (1991)
78. Olver, F.W.J.: Whittaker functions with both parameters large: uniform approximations in terms of
parabolic cylinder functions. Proc. Royal Soc. Edinb. Sect. A 86, 213–234 (1980)
79. Pastor-Satorras, R., Vespignani, A.: Epidemic dynamics and endemic states in complex networks.
Phys. Rev. E 63, 066117 (2001)
80. Pearson, J.: Computation of Hypergeometric Functions, Dissertation, MSc in Mathematical Mod-
elling and Scientific Computing, University of Oxford (2009), available at https://sites.google.com/
site/johnpearsonmaths/research
81. Pierro, V., Pinto, I.M., Spallicci di Filottrano, A.D.A.M.: Computation of hypergeometric functions
for gravitationally radiating binary stars. Mon. Not. Royal Astron. Soc. 334, 855–858 (2002)
82. Potts, P.J.: Computable real arithmetic using linear fractional transformations. Report, Department
of Computing, Imperial College of Science, Technology and Medicine, London (1996), available at
http://citeseer.ist.psu.edu/potts96computable.html
83. Press, W.A., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes: The Art of
Scientific Computing. 3rd edn. Cambridge University Press (2007)
84. Rakha, M.A., El-Sedy, E.S.: Application of basic hypergeometric series. Appl. Math. Comput. 148,
717–723 (2004)
85. Roach, K.: Hypergeometric function representations, pp. 301–308. Proceedings of the 1996 Interna-
tional Symposium on Symbolic and Algebraic Computation (1996)
86. Schmelzer, T., Trefethen, L.N.: Computing the gamma function using contour integrals and rational
approximations. SIAM J. Numer. Anal. 45, 558–571 (2007)
87. Seaborn, J.B.: Hypergeometric Functions and their Applications. Springer-Verlag (1991)
88. Segura, J., Temme, N.M.: Numerically satisfactory solutions of Kummer recurrence relations.
Numer. Math. 111, 109–119 (2008)
89. Spouge, J.L.: Computation of the gamma, digamma, and trigamma functions. SIAM J. Numer. Anal.
31, 931–944 (1994)
90. Slater, L.J.: Confluent Hypergeometric Functions. Cambridge University Press (1960)
91. Slater, L.J.: Generalized Hypergeometric Functions. Cambridge University Press (1966)
92. Temme, N.M.: Asymptotic Methods for Integrals. Series in Analysis 6, World Scientific, NJ
(2015)
93. Temme, N.M.: Large parameter cases of the Gauss hypergeometric function. J. Comput. Appl. Math.
153, 441–462 (2003)
94. Temme, N.M.: Numerical and asymptotic aspects of parabolic cylinder functions. J. Comput. Appl.
Math. 121, 221–246 (2000)
95. Temme, N.M.: Numerical aspects of special functions. Acta Numer. 16, 379–478 (2007)
96. Temme, N.M.: The numerical computation of the confluent hypergeometric function U (a, b, z).
Numer. Math. 41, 43–82 (1983)
97. Temme, N.M.: Special Functions: An Introduction to the Classical Functions of Mathematical
Physics. Wiley (1996)
98. Temme, N.M.: Uniform asymptotic expansions of confluent hypergeometric functions. J. Inst. Math.
Appl. 22, 215–223 (1978)
99. Temme, N.M.: Uniform asymptotics for a class of integrals in terms of modified Bessel func-
tions, with application to confluent hypergeometric functions. SIAM J. Math. Anal. 21, 241–
261 (1990)
100. Torrieri, D., Valenti, M.C.: The outage probability of a finite ad hoc network in Nakagami fading.
IEEE Trans. Commun. 60, 3509–3518 (2012)
101. Trefethen, L.N., Weideman, J.A.C., Schmelzer, T.: Talbot quadratures and rational approximations
BIT. Numer. Anal. 46, 653–670 (2006)
Numer Algor
102. Vitalis, R., Gautier, M., Dawson, K.J., Beaumont, M.A.: Detecting and measuring selection from
gene frequency data. Genetics 196, 799–814 (2014)
103. Wang, X., Duan, J., Li, X., Luan, Y.: Numerical methods for the mean exit time and escape prob-
ability of two-dimensional stochastic dynamical systems with non-Gaussian noises. Appl. Math.
Comput. 258, 282–295 (2015)
104. Watson, G.N.: The harmonic functions associated with the parabolic cylinder. Proc. Lond. Math.
Soc. 2, 116–148 (1918)
105. Weideman, J.A.C.: Optimizing Talbot’s contours for the inversion of the Laplace transform. SIAM
J. Numer. Anal. 44, 2342–2362 (2006)
106. Weideman, J.A.C., Trefethen, L.N.: Parabolic and hyperbolic contours for computing the Bromwich
integral. Math. Comput. 76, 1341–1356 (2007)
107. Wimp, J.: Computation with Recurrence Relations. Pitman (1984)
108. Zhang, S., Jin, J.: Computation of Special Functions. Wiley (1966)
109. Zhao, C., Yang, C.: An exact solution for electroosmosis of non-Newtonian fluids in microchannels.
J. Non-Newtonian Fluid Mech. 166, 1076–1079 (2011)
110. Digital Library of Mathematical Functions, National Institute of Standards and Technology, available
at http://dlmf.nist.gov/
111. M ATLAB, The Mathworks Inc., Version R2015a (2015)
112. Mathematica, Wolfram Research, Inc., Mathematica, Version 8.0 (2010)
113. The NAG Toolbox for M ATLAB, The Numerical Algorithms Group (2013)
114. http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric1F1/10/
115. http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric2F1/10/
116. http://datashare.is.ed.ac.uk/handle/10283/607