2. Stirling’s Formula
Stirling’s formula [
1] for the factorial function is often written for large integers,
n, as
As this is accurate to within 1% for
, it represents a good approximation in standard (Poincaré) asymptotics [
2], but not so in hyperasymptotics. Moreover, our aim is to consider complex values, not large integers. Thus, we replace the factorial function by the more general gamma function,
. The terms in (
1), denoted here by
, then become the leading terms of the complete asymptotic expansion for
. They will be treated as a separate contribution in all calculations of
, so that the reader will be able to observe just how inadequate standard asymptotics is compared with hyperasymptotics.
Occasionally, a problem arises where there is an interest in the missing terms in (
1). Then Stirling’s formula is expressed differently. For example, according to No. 6.1.41 in [
9], for
and
,
is given by
where
represents all the terms in Stirling’s formula, namely,
Hence the leading terms are identical to those in (
1). In other texts the dots in (
2) are replaced by the Landau gauge symbol, which would be
here since it is the next highest order term. In [
10] the power series after
is truncated with the coefficients expressed in terms of the Bernoulli numbers, while the remainder term,
in No. 8.344, is given as
Although the remainder is dependent upon
z and
N, for
, the series diverges once
N passes the optimal point of truncation,
. Moreover, the above result is even more vague than (
2) because the expansion is only valid for “large” values of
without indicating what large means. Here, we shall evaluate exact values of
from the complete version of Stirling’s formula by following the concepts and theory in [
6], but before this can be done, the following lemma is required.
Lemma 1. Via regularization, the power/Taylor series expansion for , namely, , can be expressed as Proof. For brevity, the proof is not given here, but appears in [
11]. □
It should be noted that an equivalence symbol appears in one of the results, indicating that one side possesses a divergent series, while the other side represents a finite regularized value. That is,
is defined for all values of
u, while the series representation for the function is divergent when
u does not lie within
. Since the equivalence symbol is less stringent than an equals sign, we can re-write the lemma as
Therefore, if the series appears in a problem, then it can be replaced by the right-hand side (rhs). Though equivalence statements will appear throughout this paper, it does not necessarily mean that a power series is divergent for all values of the variable.
Now we derive the complete form of Stirling’s formula. This will not be original, but we need to establish that it is complete. Binet’s second expression for
in [
2] is
By making a change of variable,
, and noting that
z is complex, we can then introduce (
5). Replacing
k by
yields
The left-hand side (lhs) of (
8) is finite (convergent), while the rhs can be either divergent or convergent. From No. 3.411(1) in [
10], the integral in the above equivalence is equal to
, where
represents the Riemann zeta function. Thus, the above result becomes
From here on,
denotes the series on the rhs. On the other hand, Paris and Kaminski [
12,
13], replace the terms on the lhs by
. With the aid of the reflection formula for the gamma function, the following continuation formula can be derived:
This enables one to obtain values of
whenever
z is situated in the left-hand complex plane via the corresponding values in the right-hand complex plane. Furthermore, the rhs will play an important role when the Stokes phenomenon is discussed later.
In order to continue with this study, the following definitions are required:
Definition 1. An asymptotic (power) series is defined here as an infinite power series with zero radius of absolute convergence.
Definition 2. An asymptotic form is composed of: (1) a complete asymptotic expansion, which not only possesses all terms in a dominant asymptotic power series, e.g., above, but also all the terms in each subdominant asymptotic series, should they exist, and (2) the common sector or ray in the complex plane over which the argument of the variable in each series is valid.
By truncating
at
N terms, we arrive at
where the first term will be denoted as
,
N is the truncation parameter and
represents a specific value of the cosecant polynomials [
14], given by
The infinite series over
k in the second term is known as a generalized Type I terminant [
6]. Terminants were first introduced by Dingle [
15] because he found that special functions often possess asymptotic series whose late coefficients exhibit gamma function growth, viz.
. A Type II terminant differs in that the coefficients possess an extra phase factor of
.
The notation
was introduced in [
6] to denote the generalization of Dingle’s Type I terminants, which are defined as
Alternatively, (
11) can be expressed as
Thus,
and
z in (
13) are equal to 2 and
in (
14). Although [
6] states that both
p and
q have to be positive and real, it is
, which appears in the regularized value of a generalized terminant. Therefore, provided
, the regularized value of the series still exists. Alternatively,
k can be replaced by
in the infinite series in (
14), in which case
q equals unity. Since
, we can apply the result in [
6] to
instead.
According to Rule A in ([
15], Chapter 1), Stokes lines occur whenever the arguments or phases of the variable result in the terms of an asymptotic series becoming homogeneous in phase and having the same sign. In the case of the generalized terminant in (
13), this means that Stokes lines occur whenever
, for
l, an integer. Then the terms in either
or
are all positively real. Because
l is arbitrary, we can replace
by
. Thus, we find that the Stokes lines for
occur whenever
, i.e., at half integer multiples of
.
The concept of a primary Stokes sector/line was introduced in [
6] to indicate the first Stokes sector/line over which an asymptotic expansion is derived. It was also necessary to define asymptotic forms since two functions can have the same complete asymptotic expansion, but will still be different if the expansion applies over different primary Stokes sectors or lines. For example, in solving a problem for positive real values of the variable, one may obtain a generalized Type I terminant as the asymptotic solution. However, as the variable moves off the real axis, it will acquire subdominant semi-residue contributions of opposing signs in either direction as a result of the Stokes phenomenon. However, if the same asymptotic solution is obtained for positive imaginary values of the variable, then as the variable hits the positive and negative real axes, the asymptotic solution will acquire a semi-residue contribution. When the variable moves into the lower half of the complex plane, the asymptotic solution will acquire a full residue contribution. Clearly, both cases are different and will yield different values even though the same generalized Type I terminant was derived. Hence the original functions or solutions for these cases are different. In the first case the positive real axis becomes the primary Stokes line for the generalized Type I terminant, while in the second case, the upper half of the complex plane represents the primary Stokes sector. Then as more secondary Stokes sectors/lines are encountered either in a clockwise or anti-clockwise direction from the primary Stokes sector/line, more Stokes discontinuities arise at the boundaries. Although the choice of a primary Stokes sector/line is arbitrary, it will be taken here to be the Stokes sector/line situated in the principal branch of the complex plane, since most asymptotic expansions are derived under the condition that the variable lies initially in the principal branch of the complex plane.
Before we can regularize the asymptotic series, , we require the following lemma:
Lemma 2. Regularization of the Taylor series for the logarithmic function yields Proof. There is no need for the proof to appear here as it can be found in [
16]. □
As in the first lemma, we can replace the equals sign in the lemma by the less stringent equivalence symbol, which reduces the lemma to
With this result we can now regularize
, which will enable the asymptotic forms for
to be derived.
Theorem 1. As a result of the regularization of its asymptotic power series, the logarithm of the gamma function possesses the following asymptotic forms:where the remainder is given byand the Stokes discontinuity term is given byThe remainder is valid for either or , where M is a non-negative integer. However, the Stokes discontinuity term possesses two forms that are complex conjugates. The upper-signed version of (19) applies to , while the lower-signed version is valid over . For z lying on the Stokes lines, i.e., for , and are replaced by and , respectively. Then the remainder is given bywhile the Stokes discontinuity term becomes In (
20),
P denotes the Cauchy principal value.
Proof. For brevity, the proof is not presented here as it can be found in [
11]. □
The remainder in Theorem 1 is conceptually different from the remainder term in standard Poincaré asymptotics, which is expressed in terms of the Landau gauge symbol,
, or as
In fact, (
17) would typically be written as
Moreover, by introducing
,
,
and
, into the above result, we obtain (
2). For real values of
z, (
22) is referred to as a large
z or
expansion with the limit point at infinity. For
z complex, it becomes a large
expansion. In other cases, where the Landau gauge symbol is omitted, a tilde often replaces the equals sign. Nevertheless, in all these representations it means that the later terms in the truncated power series have been neglected despite their eventual divergence past the optimal point of truncation.
3. Numerical Analysis
In the previous section the asymptotic forms for
were derived via Borel summation. However, we still need to verify that these results yield exact values of the special function. This section aims to present such a numerical analysis. For the analysis to be effective, a large number of values of
is not required. This is because the results change across Stokes sectors or rays, but within each sector or on each line, they behave uniformly with respect to
z. Thus, a few values of
are necessary for testing the validity of the asymptotic forms. In fact, only two values of
are necessary: a relatively large one, where the asymptotic series in (
17) can be truncated, and a small one, where truncation breaks down completely. Then a range of values for both
N and
or
, need to be considered across the Stokes sectors and lines. Note also that selecting extremely large/small values of
may result in overflow or underflow problems in the numerical calculations. This would then give the misleading impression that the asymptotic forms are incorrect rather than implying a deficiency in the computing system. Since the variable in the asymptotic series is
with
n ranging from unity to infinity,
is deemed to be sufficiently large, while for
, there is no optimal point of truncation. The second value is, therefore, sufficiently small to demonstrate the breakdown of standard Poincaré asymptotics.
Before undertaking the numerical analysis, let us present plots of
to help the reader understand the nature of the function.
Figure 1 displays graphs of the real part of the function for several fixed values of
used in this paper as a function of
over
. There we see for the larger values of
, the real part of
dips to a minimum before it begins to grow dramatically, which is the rapid exponentiation mentioned in the introduction. The smaller values of
do not vary as much, although both are similar to the larger values of
in that they dip to a minimum and rise afterwards. Unlike the other graphs, the graph for
has a positive minimum and increases rather slowly.
Figure 2 displays graphs of the imaginary part of
for the same fixed values of
as a function of
over
. Here we see that the large values of
rise to a positive maximum before rapidly decreasing into the negative right quadrant. The plot for
does not attain a positive maximum, but decreases relatively slowly from the origin into the negative right quadrant. The graph for
follows that for
until about
. Then it decreases faster than the
graph, but when
is close to
, it rises until it meets the
graph at
.
The optimal point of truncation,
, is determined by calculating the first value of the truncation parameter,
N, when successive terms in an asymptotic series begin to dominate the preceding terms. That is, it occurs at the first value of
k, where the
-th term is greater than the
k-th term in
, namely,
Since the ratio of the Riemann zeta functions is close to unity, we observe that
occurs around
. Therefore, for
,
will be close to 10, while for
, it does not exist, meaning that
. In the latter case the first or leading term of the asymptotic series will yield the “nearest” value to
, but it will not be accurate. On the other hand, the larger
is, the more accurate truncation of the asymptotic series becomes.
Typically, when a software package such as Mathematica [
17] determines values of a special function, it only does so over the principal branch of the complex plane. Hence, the numerical analysis will be confined to
over
, which means in turn that the numerical analysis of (
17) will only be conducted over the three Stokes sectors,
,
and
, and the two Stokes lines at
. In other words, only the
and
results in Theorem 1 will be tested for the time being. By denoting the truncated sum in (
17) by
, i.e.,
we need to verify the following results:
In the above the superscripts, U and L, have been introduced into the Stokes discontinuity terms in the Stokes sectors to indicate the upper- and lower-signed versions of (
21). Although equal to zero, the Stokes discontinuity term for the third asymptotic form will be denoted as
.
If we put
in the third result of (
24) and neglect the final term or remainder, then we arrive at (
2). However, the remaining terms in this result are now expressed as
and
while the Stokes discontinuity terms are given by
and
Note the connection with
mentioned below (
9).
For the numerical analysis we need to consider the results over the Stokes sectors separately from those at the Stokes lines since the latter require the evaluation of the Cauchy principal value and the Stokes discontinuity terms possess a factor of compared with zero when or unity when . Thus, will be evaluated via two different Mathematica modules: one involving the standard numerical integration routine called NIntegrate, and another, where NIntegrate is adapted to evaluate only the Cauchy principal value.
When
, the Stokes discontinuity terms can be combined into one expression, denoted by
. This is given by
where the Stokes multiplier,
, is written as
Similarly, the Stokes discontinuity terms in the lower half of the principal branch,
, can be written in terms of another Stokes multiplier,
, as follows:
where
is given by
From the above, we see that the Stokes multipliers are discontinuous, which is known as the conventional view of the Stokes phenomenon. However, an alternative view of the Stokes phenomenon arose in the late 1980s where they were no longer regarded as step-functions. Instead, it was proposed that they undergo a smooth, but rapid, transition from zero to unity, equalling
at the Stokes line [
18]. Today, this is known as Stokes smoothing, despite the fact that Stokes never regarded the multipliers as being smooth [
19]. According to this approach, first put forward by Berry and then made more “rigorous” by Olver [
20], the Stokes multiplier reduces to the error function,
. Later, Berry [
21] and Paris and Wood [
22] found an approximate form for the Stokes multipliers of
, which were given as
A graph of (
34) for
versus
is displayed in
Figure 3 together with the conventional view or (
31). For
, (
34) is virtually zero, while for
, it is almost equal to unity. In between, however, the rapid smoothing occurs with the greatest deviation from the step-function occurring in the vicinity of the Stokes line where both views possess a common (green) point at (
/2, 1/2). If smoothing occurs, then Theorem 1 cannot possibly yield exact values of
, especially for
between
and
excluding
.
We can establish the correct view by calculating
for
between
and
using (
30) since smoothing implies that (
30) cannot possibly yield exact values of
. However, if we obtain exact values of
, then we know that the conventional view holds and smoothing is a fallacy. The problem with testing (
34) directly is that it applies to much larger values of
than 3. The proponents of smoothing have not provided the form for smaller values of
. For very large values of
, truncating the asymptotic expansion at a few terms will yield very accurate values for
, which can obscure both views unless an extremely high precision and time-consuming analysis is undertaken. Hence much smaller values of
will be considered in (
30), so that the Stokes discontinuity term can no longer be neglected.
Before Stokes smoothing can be investigated, we must show that (
24) behaves as a typical asymptotic expansion. That is, we must show that for large values of
, the remainder can be neglected to yield accurate, but nevertheless approximate, values of
up to and not very far from the optimal point of truncation, while for small values of
, it is simply invalid to neglect the remainder. For this demonstration we do not require the Stokes discontinuity terms. Thus, we shall study the asymptotic series for
, in particular
, because it does not require complex arithmetic.
From (
26) we see that the evaluation of the remainder involves two computationally intensive tasks. The first is the infinite sum over
n, which arose due to an infinite number of singularities lying on each Stokes line. The second issue is the numerical integration of the exponential integral. The latter can be avoided by decomposing the denominator into partial fractions and using No. 3.383(10) from [
10]. For
, one then obtains
The above result can also be obtained by combining (4.3), (4.10) and (4.11) in [
22].
A module was written to evaluate
in Mathematica with the remainder given by (
35) and
n set to an upper limit of
to ensure 50 figure accuracy.
Table 1 displays a small sample of the results obtained from the code. For more details about the code including its performance and listing as well as other results, the reader should consult [
11]. Note that all the results are real, which is to be expected since
. In actual fact, Mathematica printed out a tiny imaginary part with each value, but it was often zero to the first 50+ decimal places and thus was discarded. The appearance of these tiny imaginary values indicates the size of the numerical error. The few cases where the errors were less than 50 decimal places will be discussed shortly.
The first column displays the values of the truncation parameter,
N for each calculation. The second row in the table gives the value of Stirling’s formula for
, which only agrees with the actual value of
at the bottom of the table to the first decimal place. For each value of
N there are three rows. The first row labelled TS displays the value of the truncated sum in (
25), while the row labelled
presents the value of the remainder given by (
35) with the upper limit set to
. The third row labelled Sum is the sum of Stirling’s formula, the truncated sum and the remainder. It yields the same value of
as at the bottom of the table except for
.
For
, the truncated sum and remainder equal
and
, respectively. When they are summed with
, they yield a value that agrees with
to 19 decimal places, which is well-below the 50 decimal figure accuracy mentioned above and nowhere near as accurate as other results such as
. The reason this has occurred is that the factor of
in the denominator of (
26) affects the calculation of the remainder for the small values of
N such as 1 or 2. In these cases the upper limit of
needs to be increased substantially to improve the accuracy, which does not apply for higher values of
N.
The remainder is smallest in magnitude when
, which agrees with our estimate below (
23) for the optimal point of truncation,
. For
, the sum of the values only differs from the actual value of
at the fifty-third decimal place. Moreover, for
N close to
, there is little deterioration in the accuracy, but for
and 50, well past
, the remainder dominates, whereas in the other calculations, it is small. This is consistent with standard Poincaré asymptotics, where the remainder is neglected. Therefore, for all but the last two calculations, Stirling’s formula yields the main contribution to
. For the last two values of
N, the truncated sum and remainder dominate, but their divergence is cancelled out. For example, when
, the remainder and truncated sum are
. Hence the first 26 decimal places of both quantities cancel each other, thereby enabling Stirling’s formula to become the main contribution. Unfortunately, losing these decimal places produces an imaginary term that is zero to a reduced number of decimal places, 23 instead of 50+ as mentioned above.
Now consider
, which is unheard of in standard Poincaré asymptotics and also in the hyperasymptotic calculations of [
12,
18,
21,
23,
24]. Furthermore, Paris [
13] has specifically carried out a hyperasymptotic calculation of
using Hadamard expansions for
. Depending on the number of chosen levels, his results are accurate at best to
for
(
). Hence
Table 1 displays far more accurate results, but with
.
Table 2 presents a sample of results for
in the third asymptotic form of (
25) with
given by (
35). In this case Stirling’s formula is nowhere near as accurate as in
Table 1. Except for
, adding the truncated series to Stirling’s formula worsens the accuracy. This has arisen because there is no optimal point of truncation. Therefore, the remainder must be evaluated. As a result that the remainder diverges far more rapidly in this case, there is a greater cancellation of decimal places than in
Table 1. Thus, the total values in
Table 2 are generally not as accurate, the exception being very low values of
N. Despite this, these results could not have been achieved without regularization.
Now we assume that the routine, Gamma[
], does not exist in Mathematica. Then a new program implementing the first, third and fifth asymptotic forms in (
25) with the remainder given by (
26) is required. As before, the upper limit in the sum will be set to
. To calculate each term in the remainder, the program, which appears as the second program in the appendix of [
11], employs NIntegrate inside a Do loop. Since it is a different approach for calculating
, it can be used to check the results in
Table 1. The version in [
11] has the precision and accuracy goals set to 30 for thirty figure accuracy, which means, in turn, that the working precision must be set to a much higher level, e.g., 60. Higher values for these options can be set, but it comes at the expense of computing time. The integrand employed in NIntegrate is called Intgrd and is basically the integrand in (
26). Due to lack of space, the calculated quantities are displayed here to 25 decimal places, although they were frequently far more accurate. In addition, unlike the previous calculations, we consider complex values of
z, i.e.,
takes on values within the principal branch of the complex plane except at
. For brevity, only
is presented here. The results for
appear in Table 3 of [
11].
Table 3 presents a very small sample of the results obtained by running the second program in the appendix of [
11] with
. Although positive values of
were considered, only negative values are displayed here. In the table, there are six results for each value of
N and
. Stirling’s formula is represented by the first value. The second value, denoted by TS, represents the value of the truncated sum in (
24), while the third value is the regularized remainder, (
26), as evaluated via NIntegrate. The fourth value for each calculation of
is the Stokes discontinuity term, which according to (
32) is zero for
and is purely logarithmic for
over
. The fifth value, denoted by Total, represents the sum of the four preceding values, while the final value is the actual value of
using LogGamma[
z] in Mathematica.
Since there is no optimal point of truncation, the results in
Table 3 for
are mainly dominated by the truncated sum and its regularized remainder. In fact, both values dominate so much that many decimal places are cancelled as observed for
and 50 in
Table 1. Once again, pressure is being put on the accuracy of the final total. For example, for
and
, both the truncated sum and the regularized remainder are
, which means a loss of thirteen decimal places when they are summed. Since the accuracy and precision goals were set to 30, this implies that the sum of the truncated series and the regularized remainder should only be accurate to 17 decimal places. Fortunately, the total value agrees with the value of
to 28 decimal places because the working precision was set much higher (to 60) than the precision and accuracy goals.
Although
provides a substantial contribution to
, it is no longer accurate. The truncated sum is capable of improving the accuracy slightly for small values of the truncation parameter. For example, when the truncated sum is added to
for
and
, the real part is closer to the real part of
, but not so the imaginary part. In fact, all the results are dominated by the truncated sum and its regularized remainder, but since they act against each other, their sum is not as large as Stirling’s formula. Nevertheless, one cannot neglect the remainder as in standard Poincaré asymptotics. In order to obtain the exact value of
via (
25), the remainder must counterbalance the truncated sum, which will only occur if the regularization has been performed correctly. When the regularized remainder is included in the total, exact values of
are obtained. For
, however, the Stokes discontinuity term must be included. In fact,
is greater than the sum of the truncated series and the regularized remainder, which highlights its importance outside the primary Stokes sector.
So far, we have managed to verify the asymptotic forms in (
25) connected with Stokes sectors. Now we consider the asymptotic forms for the two Stokes lines. As
is fixed in both asymptotic forms, the Stokes discontinuity term will only depend upon
. In other words, it is solely real. Furthermore, since
depends only on odd powers of
z in (
24),
and
must be imaginary along both Stokes lines. This is consistent with Rule D in ([
15], Chapter 1), which states that an asymptotic series crossing a Stokes line generates a discontinuity that is
out of phase with the series on the line.
The third code in the appendix of [
11] implements the second and fourth asymptotic forms of (
25) in Mathematica. This program is very different from the previous program because it includes a Which statement in the Do loop. This is necessary because the singularity in the Cauchy principal value integral in (
27) alters with each value of
n. Moreover, the integral has been divided into several smaller intervals in order to achieve the best possible accuracy. The interval in which the singularity is situated is then determined via the Which statement. This interval is, in turn, divided into two intervals to avoid the singularity in accordance with the definition of the principal value. To ensure that the principal value is evaluated without encountering convergence problems, the option Method—>PrincipalValue must also be introduced into NIntegrate. Finally, in order to achieve the same accuracy as in
Table 3, WorkingPrecision has been increased to 80. Hence the program takes much longer to execute.
Table 4 presents a sample of the results generated by running the third program in [
11] with the variable modz set equal to 3. A similar set of calculations was performed for modz equal to 1/10, whose results appear in Table 6 of [
11], but for brevity, they are not presented here. Although both Stokes lines were considered by putting the variable theta in the program equal to
, only the results for positive values of theta are presented here, again for the sake of brevity. The calculations took much longer for larger values of the truncation parameter, ranging from 26 hrs for
to 47.5 hrs for
. Because the values of
and
are independent of the truncation parameter, they only appear once at the top of the table, while their sum appears immediately below them in the row labelled Combined. As stated above, the Stokes discontinuity term is purely real, whereas the truncated sum and regularized value of the remainder are purely imaginary. Therefore, the real part of the value in the Combined row represents the real part of
, which can be checked by comparing it with the real part of
at the bottom of the table. Thus, the Stokes discontinuity term only corrects the real part of Stirling’s formula on a Stokes line. On the other hand, the imaginary part of
can only be calculated exactly if the regularization of (
25) has been performed correctly. The last decimal figure of the imaginary part of
was printed out as a 6 instead of a 5, because the accuracy was set to 25 decimal places in the output stage. Since more than 25 figures appear in the table, this statement should have been modified to consider a higher level of accuracy. Therefore, we should only be worried when the results agree for less than 25 decimal places. The redundant places have been introduced here to indicate that the results in the Total column have been computed via a different approach from the LogGamma routine in Mathematica at the bottom of the table. That is, we should expect differences to occur at some stage, but only outside the specified level of accuracy.
In the table we see that the regularized value of the remainder decreases steadily until the truncation parameter reaches around 11, before it begins to diverge. Note that the imaginary part of the Total value for is only accurate to 6 decimal places compared with the imaginary part of . As discussed previously, this arises because the power of n in the denominator of is zero when N is equal to unity. Though not displayed in the table, the remainder at the optimal point of truncation, , has a minimum magnitude of . Beyond this point, the magnitude of the regularized value of the remainder increases so that its magnitude is for . By the time , both the truncated series and regularized value of the remainder dominate the calculation, but since they act against each other, they combine to yield the extra imaginary value enabling the imaginary part in the Combined row to agree with . In fact, the most surprising result in the table is the last result for because at least 25 decimal places cancel before we obtain the regularized value for the entire asymptotic series. As mentioned previously, the cancellation of these decimal places puts pressure on the accuracy and precision goals, which have been set to 30, as stated above. Fortunately, because WorkingPrecision was set to 80, it appears that the neglected terms in setting a limit of in the summation are negligible. Thus, the remainder has been evaluated to a much greater accuracy than specified by the accuracy and precision goals in the program. Consequently, the Total value for agrees with the actual value of .
So far, we have not seen any evidence of Stokes smoothing as espoused by Berry [
18], Olver [
20] and Paris, Kaminski and Wood [
12,
13,
25]. As indicated earlier, smoothing implies that there is no discontinuity in the vicinity of a Stokes line, whereas we have been able to obtain exact values of
near Stokes lines assuming the existence of a discontinuity. Because such smoothing occurs rapidly in the vicinity of Stokes lines, it could perhaps be argued that we have not investigated the asymptotic behaviour of
sufficiently close to the Stokes lines. If a rapid transition does occur, then it means that we have still not exactified the Stokes approximation in the vicinity of the Stokes lines. From
Figure 3, which represents the situation for
, Stokes smoothing is expected to be most pronounced for
lying between
and
. Alternatively, the Stokes multiplier is expected to be quite close to 1/2 for small values of
, where
and
. On the other hand, if the conventional view of the Stokes phenomenon is valid, then the Stokes multiplier
will equal unity for
and zero for
according to (
31). Thus, a narrow region of positive and negative values of
exists, where one of the views can be disproved. In summary, introducing very small values of
into the respective asymptotic forms of (
24) should not yield exact values of
if smoothing occurs since the Stokes multiplier should be close to 1/2 and not toggle between zero and unity according to the sign of
.
Table 5 presents a small sample of the results obtained by running the second program in [
11] for
and various values of
, where
. The code was run for different values of
N except those close to unity for the reason given above. For each positive value of
, there are three rows of values, while for each negative value there are only two rows because the Stokes discontinuity term is zero. The first row for each value of
, labelled LogGamma[
z] in the Method column, represents the value obtained from the LogGamma routine in Mathematica. Depending upon the sign of
, the second row displays the Stokes discontinuity term. In general, this term was found to possess real and imaginary parts of
or even a couple of orders lower. The next value for each value of
is labelled either 1st AF or 3rd AF in the Method column according to whether the first or third asymptotic form in (
25) was used to calculate the value of
. For brevity, the values of the truncated sum, the regularized value of the remainder and Stirling’s formula do not appear in the table.
It should be noted that when is extremely small, e.g., , NIntegrate experiences convergence problems because the integration is now too close to the singularities on the Stokes line. For example, when , the program printed out a value that agreed with the actual value to 25 decimal places for the real part, but the imaginary part only agreed to 18 decimal places. Although this calculation is not presented in the table, it does represent a degree of success since the imaginary part of the Stokes discontinuity term is . That is, the Stokes discontinuity term still had to be correct to the first six decimal places for the agreement to occur at 18-th decimal place.
For
in the table, the first asymptotic form in (
25) yields the exact value of
even though the Stokes discontinuity term is very small. Nevertheless, in the case of Stokes smoothing, this term should be almost half the values appearing in the table. For
, if smoothing occurs, then the third asymptotic form in (
25) should also not yield exact values of
because it is missing almost half the Stokes discontinuity term. Yet, we observe the opposite; the third asymptotic form yields exact values of
for
. Therefore, Stokes smoothing does not occur. These results are discussed in more detail in [
26].
An explanation why Stokes smoothing is fallacious appears in ([
6], Section 6.1), where it is shown that the form for the Stokes multiplier given by Berry and Olver is based on applying standard asymptotic techniques. Olver’s “rigorous proof” [
20] involves truncating an asymptotic series via Laplace’s method. Since only the lowest order terms are retained in this approach, Olver arrives at the error function result for the Stokes multiplier. The neglected higher order terms are not only divergent, but are also extremely difficult to regularize. If they could be regularized, then they would produce the necessary corrections to turn the smooth function in
Figure 3 into a step-function, thereby confirming the conventional view of the Stokes phenomenon.
5. Further Numerical Analysis
According to the definition of the regularized value [
4,
5,
6,
7], it must be invariant irrespective of how it is obtained. Therefore, we need to demonstrate that the MB-regularized forms in Theorem 2 yield identical values to the Borel-summed forms in Theorem 1, especially for the higher Stokes sectors and lines not studied previously. To access the higher/lower sectors or lines, higher powers of the variable
z need to considered such as
in
. This is tantamount to finding an asymptotic solution to a problem, which happens to yield the asymptotic forms of
. In this case the principal branch is still
, but Mathematica is only able to evaluate
for
over
.
From Theorem 2, two different representations exist for the regularized value of
since replacing
M by either
or
in (
36) produces a different asymptotic form, where each is valid over one half of the domain of convergence for
. For example, the upper-signed version of (
36) is valid for
when
, while for
and
, it is only valid over
and
, respectively. Thus, the
result is valid for the bottom half of the domain of convergence for
, while the
result applies to the top half of the domain of convergence for
. This means that we are not only able to evaluate
for higher/lower values of
or
, but we can check the results against the asymptotic forms from overlapping domains of convergence. In addition, the
results can be checked with the values of
evaluated by Mathematica. Finally, we can check to see whether the MB-regularized forms of
yield identical values to the corresponding Borel-summed asymptotic forms in Theorem 1. Previously, we had no method of checking whether the Borel-summed asymptotic forms for
outside the principal branch were correct. Now this problem can be tackled by comparing the resulting Borel-summed asymptotic forms when
z is replaced by a power of itself with the corresponding MB-regularized forms.
If
z is replaced by
, then for
or
, (
36) becomes
where
and
In (
40),
represents the truncated part of the asymptotic series,
at
N, as in (
25), while the subscript U or L in (
42) denotes whether the upper-signed or lower-signed version has been used. For
, the subscript is dropped. Thus,
is composed of Stirling’s formula, the truncated series and an MB integral as the regularized value of the remainder. On the other hand, for
, the upper-signed version of (
36) yields
The domain of convergence for this integral is
, but it is not valid when
since
is discontinuous whenever
excluding
. For
, (
38) can be used, but all that happens is the logarithmic term on the right-hand side of (
43) is replaced by
, which indicates that there is no discontinuity in
at
.
For
, when
,
. The upper value of
lies in the domain of convergence for (
43). In (
36), we substitute (
39) with
z equal to
for
. Then we arrive at
As a result of the penultimate term, we expect a discontinuity when (
44) is evaluated later. In addition, we can replace
and
in (
40) by
and
, respectively, while
in (
44) can be replaced by
.
When compared with (
40), we see that (
43) and (
44) possess extra terms, which are similar to the Stokes discontinuity term in the Borel-summed asymptotic forms of Theorem 1. The difference here is that the lines of discontinuity are located in the domains of convergence. Thus, the asymptotic form is only different on the lines, whereas with Stokes lines, the regularized value is different before, on and after them. Moreover, we expect both forms for
to yield identical values when the domains of convergence overlap, i.e., over
. This does not occur with the Stokes phenomenon, indicating again that MB regularization is different from Borel summation.
For
and 3, the upper-signed version of (
36) with
z replaced by
yields
These results, which are similar to (
43) except for the logarithmic terms, are not valid for
and
.
For
and
, (
39) was used to derive the asymptotic form of
. However, when
,
can also equal
, but now the upper-signed version of (
42) with
applies. Moreover,
is determined by putting
and replacing
z by
in (
38). Hence for
and
, we find that
For
, we have either
when
or
when
. In the first case
is given by (
38) with
and
. In the second case (
39) applies with
and
. Thus, we obtain
The corresponding lower-signed results from (
36) with
z replaced by
are simply complex conjugates of the above results. For brevity, they are not presented here. However, the interested reader will find them in ([
11], Section 5).
Two separate numerical analyses will be presented here: the first aims to show the agreement between the MB-regularized asymptotic forms for
and their Borel-summed counterparts, and the second deals with the behaviour of
at the Stokes lines/rays. The first one includes an explanation of how to evaluate
from the MB-regularized asymptotic forms. Then the results are compared with the Borel-summed asymptotic forms in
Section 3 with
z replaced by
. We shall observe that although both MB-regularized asymptotic forms are defined at each Stokes line, they give incorrect values of
with the difference being discontinuous jumps of
. The second study at the Stokes lines/rays will be concerned with obtaining the correct values of
via both the Borel-summed and MB-regularized asymptotic forms by applying the Zwaan–Dingle principle [
6,
15], which states that an initially real function cannot suddenly become imaginary.
Since there are no Stokes lines of discontinuity in the above results, there are always two MB-regularized asymptotic forms that yield the values of for all values of or , except when and k is an integer. Thus, the values from two different asymptotic forms for the regularized value of can be checked against each other, which is simply not possible with Borel-summed results.
Because it represents a value where standard Poincaré asymptotics breaks down, we shall carry out the numerical study of the above results with
set equal to 1/10 as before. Note that the actual variable in the above asymptotic forms is
. Therefore, we are dealing with a very small value, which means that both the truncated series,
, and the MB integral in the above results begin to diverge very rapidly for relatively small values of the truncation parameter, e.g.,
. Consequently, a cancellation of many decimal places will occur when adding
to the MB integral. Despite the accuracy and precision goals being set to 30, one may not necessarily obtain a final value that is accurate at this level even though WorkingPrecision is now set higher to 80, not 60 as in
Section 3. As stated earlier, the problem can be overcome by specifying much larger values of AccuracyGoal, PrecisionGoal and WorkingPrecision in NIntegrate, but it will come at the expense of computing time.
Table 6 presents a very small sample of the results from the fourth program in the appendix of [
11] for various values of
N and
or
. There are five sets of results, four with
positive, and one where it is negative. The first row of each calculation gives the value of Stirling’s formula, while the next row displays the value of
. Then the remainder denoted by MB Int. appears. As mentioned earlier, because the domains of convergence of the MB integrals overlap one another, two different MB integrals are computed for the remainder. The first MB integral is represented by M1, while the second is represented by M2. The second MB integral is not evaluated when
and
l, an integer, as demonstrated by the third calculation. The values of
N and
appear together with the value of the first MB integral in each set. The values of
are displayed in the rows immediately after the MB integrals. Then the results for the entire asymptotic form appear, which can be compared with the value of LogGamma from Mathematica.
The first calculation in
Table 6 lists the results for
and
. Then (
40) and the complex conjugate of (
43) corresponding to M1 = 0 and M2 = -1, respectively, yield the value of
. Stirling’s formula on the first row is substantial, but not accurate, compared with the actual value from the LogGamma routine in the bottom row of the calculation. The second row of the calculation displays the value of
, which is
. Thus, at least six decimal figures need to be cancelled by the remainder or MB integral, which occurs when the value on the next row is included in (
40). The value of
(zero since M1 = 0) appears on the fourth row of the calculation, while the sum of all the preceding quantities appears in the fifth row labelled as ‘Total via M1’. The total value agrees with the actual value of
to 30 decimal places, well within the accuracy and precision limits despite the cancellation of six decimal figures. The sixth row of the first calculation displays the value of the MB integral for M2 = −1. As expected, it agrees with the first six decimal figures of the values for both the truncated sum and the MB integral in (
40). However,
, which is now non-vanishing, appears on the seventh row. There it can be seen that the real and imaginary parts of this value are much greater in magnitude than those from Stirling’s formula. If this value is summed only with Stirling’s formula, then the resulting value deviates from the value of
far more than either value on its own, but when it is summed with the truncated sum and MB-regularized remainder, it yields
to 29 decimal places despite the cancellation of six decimal figures.
The other calculations in
Table 6 are similar to the first set of results except the MB-integrals and
are evaluated according to the relevant domain of convergence. The third calculation presents less results because it has already been stated that there is only one MB-regularized form, viz. (
44), which is applicable. Nevertheless, the final result agrees with the value obtained from Mathematica. An interesting result in this calculation is that
for
because the asymptotic series is composed of purely real terms when
and
k is an integer. Hence the imaginary part of
vanishes for all these values. In addition, the imaginary part of the MB integral can be shown to vanish by splitting the integral into two integrals and making the substitutions,
in the upper half of the complex plane and
in the lower half. Then all the terms become complex conjugates of each other. Expanding out all the terms, one is left with a real integral, while the imaginary part reduces to
From Stirling’s formula we obtain
while the second term in (
48) becomes
Introducing these results into (
48) yields
In the last two calculations of
Table 6,
, which means that the LogGamma routine can no longer be used. We are now on our own, a new frontier in mathematics, where only the totals via the M1 and M2 asymptotic forms can yield the value of
. Moreover, when
equals
or
, there will only be one MB-regularized form that yields the regularized value. For these cases we require the Borel-summed regularized values as a check.
In the fifth calculation,
N is set equal to 5, which yields a value of
for the truncated sum. Hence at least 16 decimal figures need to be cancelled in order to obtain
. Since
, the domains of convergence are
and
corresponding to M1 = 1 and M2 = 2. Thus, (
43) and (
45) apply, which is interesting because
is very different in these asymptotic forms, particularly the imaginary parts. As expected, the MB integrals for both asymptotic forms yield the 17 decimal figures in the real parts needed to cancel the real part of the truncated sum,
. On the other hand, only 11 decimal figures are cancelled in the imaginary parts. As a result of the cancellation, the real parts in the totals only agree to 17 decimal figures. The same applies to the imaginary parts, which is surprising since there were less cancelled figures.
Because
is closer to the upper limit of
of the domain of convergence for (
43), one expects the total obtained via M1 in the table to be the less accurate of the two forms. In actual fact, it turns out that this value is more accurate than the total via (
45) by a few extra decimal places. Nevertheless, if WorkingPrecision is set to 100 and AccuracyGoal and PrecisionGoal to 40, then both totals are found to agree to 32 decimal places, although the computation time is more than doubled. Another method of avoiding long computation times is to keep
N as low as possible.
The final calculation in
Table 6 is similar to the previous one except that (
45) is introduced into (
40) to yield the MB-regularized asymptotic forms for
. For
, the truncated sum is
. Since the highest degree of cancellation between the truncated sum and remainder occurs here, we find that this calculation yields the least accurate results of all those in the table. Despite this fact, the final results still agree with each other to 10 decimal places. Hence the results in
Table 6 confirm the validity of the MB-regularized asymptotic forms for
.
We now consider the MB-regularized asymptotic forms near Stokes lines. Although the code should not be run when
corresponds directly to a Stokes line, one can do so since the MB integrals are defined.
Table 7 displays some of the results obtained by running the fourth program in [
11] near the Stokes lines at
,
and
with
and
. When
, the code evaluates
via (
43) and (
45) with M1 = 1 and M2 = 2, respectively. The first two results in the table display the values of (
43) and (
45) near the discontinuity at
with
. As expected, both forms of
yield identical values. At
, however, both forms yield different results, but only for the imaginary parts. In fact, there is a jump discontinuity of
between the results with the first form yielding
and the second,
. Note, however, that the discontinuities arise only from taking the logarithm of the gamma function. The gamma function itself is not discontinuous. As expected, neither result for
is correct. The correct result is the midway between
and
. That is,
.
The next set of six results display the case where
is very close to
, viz.
away. In this case both forms in (
45) are used to calculate
. Once again, both forms yield identical results below and above
. However, for
, they yield identical values for both the real and imaginary parts. In fact, although the imaginary parts have the same value of
, it is incorrect because
experiences a jump discontinuity of
. Mathematica has simply chosen the wrong value for the logarithmic terms in (
45), as explained on p. 564 of [
17]. Noting that there is a jump of
means that
, which corresponds to midway for the results before and after the Stokes line.
The final set of results in
Table 7 have been obtained for
very close to
. Because
, we can evaluate
via the LogGamma[
z] routine in Mathematica. Hence there are more results for this calculation. This calculation employs (
40) (M1 = 0) and the complex conjugate of (
43) (M2 = 1). As before, the two versions of
give identical values above and below the Stokes line at
. Moreover, they agree with the values obtained via LogGamma[
z]. The interesting point about this calculation, however, is that all three values at the Stokes line
also agree. This is expected since there is no extra logarithmic term in (
42), while in the other asymptotic form the logarithmic term is purely real for
. Thus, there is no discontinuity in
at
, which shows that Stokes discontinuities in Borel-summed regularized values can be fictitious.
The final calculation is the verification of the Borel-summed asymptotic forms for . It was not possible to check these results previously because their regions of validity do not overlap. Now we use the MB-regularized asymptotic forms to verify their Borel-summed counterparts. In addition, we can confirm that the MB-regularized asymptotic forms for , where k equals , and 3, are correct, since only one MB-regularized asymptotic form is valid for these values.
To carry out the first task, we need to replace
z by
in Theorem 1. Hence the Borel-summed regularized values for
become
where, as before,
is the truncated form of
at
N,
and
The upper- and lower-signed versions of (
55) are valid for
and
, respectively, while (
56) is only valid for
. Therefore, for
or the principal branch for
z, Stokes lines occur at
,
, and
. We shall investigate these cases after we have considered the results for the Stokes sectors first.
The Borel-summed asymptotic forms that are valid for the Stokes sectors can be expressed as
The main difference between these results and the earlier MB-regularized values is that though they possess similar logarithmic terms, they emerge in different sectors within the principal branch.
Table 8 presents a very small sample of the results obtained by running the fifth program in the appendix of [
11] with
and the upper limit in
and
set to
as in
Section 3. The first calculation displays the results obtained for
and
. Since
according to (
23), Stirling’s formula or
yields a reasonable approximation to the actual value of
, which appears at the bottom of the calculation. Consequently, the truncated sum is small, only contributing at the third decimal place. Two MB-regularized asymptotic forms apply: (1) (
40) denoted by M1 = 0, and (2) the complex conjugate of (
43) denoted by M2 = −1. The MB-Integrals in the remainder are
. For M1 = 0, there is no logarithmic term, while for M2 = −1, there is a contribution, but it is almost negligible,
. That is, the M1 = 0 and M2 = −1 calculations are virtually identical to one another, well within the accuracy and precision goals set in NIntegrate. Therefore, the totals representing the sum of
, the MB integrals and the logarithmic terms, are not only identical to one another, but they also agree with the value obtained from the LogGamma routine in Mathematica.
The result labelled Borel Rem represents the Borel-summed remainder or
in the fourth asymptotic form of (
57), where the upper limit in the sum has been set to
. Despite this truncation, it is identical to the values obtained from the MB regularized asymptotic forms. In actual fact, the Borel Rem value is identical to the first 34 decimal figures of the MB integrals, well within the accuracy and precision goals. Bearing in mind that the remainder is very small, this means that only the first 13 or so decimal figures of each remainder calculation will contribute to the totals. That is, the remainder is truly subdominant.
The second calculation displays the results for
and
, which has only one valid MB-regularized asymptotic form. In addition, Stirling’s formula, the truncated sum and the MB integral are all real, while the logarithmic term yields the imaginary contribution of
. Hence we see that
. As expected, the value of the MB integral is very small,
, while Stirling’s formula provides an accurate value for
. Appearing below the Total is the remainder of the Borel-summed version for
or
in the second result of (
57), which in turn has the same logarithmic term as (
45). Hence both calculations are expected to be identical. However, a closer inspection reveals that they agree to 23 decimal figures, but not the expected 30 specified by the accuracy and precision goals. This discrepancy, which arises from the truncation of the Borel-summed remainder, is an example where the upper limit of the sum over
n has to be set much higher in order to achieve the desired accuracy.
The final set of values have been obtained by setting
equal to
and
N to 4. Once again, there are two MB-regularized asymptotic forms, both obtained from (
45). The Borel-summed asymptotic form in this case is given by the first form in (
57). All the remainder terms are tiny,
. If only the logarithmic term for all three forms is added to Stirling’s formula, then a good approximation is obtained. In this instance the logarithmic term for the Borel-summed form is identical to the second form in (
45), but by comparing it with the value obtained via the M1=2 form, the extra term is very small indeed, only differing at the 20-th decimal place. Nevertheless, all three totals agree with each other as in the other cases in the table.
Before we can be assured that there is complete agreement between both sets of asymptotic forms, we need to carry out a final numerical analysis at the Stokes lines. The Borel-summed asymptotic forms at these lines are given by (
52), but now with
or (
54) and
or (
56). Putting
M equal to 0, 1 and 2, yields the specific forms at the Stokes lines, which are
Note the similarity of the Stokes discontinuity terms with the corresponding terms or
in the MB-regularized asymptotic forms. The major difference occurs with the logarithmic term, which is represented by either a zero or full residue contribution in the MB-regularized asymptotic forms, while it is always represented by a semi-residue or half the contribution in the Borel-summed asymptotic forms.
Table 9 presents a small sample of the results obtained by running the final program in the appendix of [
11]. Since the MB integrals yielded values of
, there was no significant cancellation of decimal figures as in
Table 8. The first column of
Table 9 displays the value of
for the respective Stokes line. Here they are presented for the Stokes lines at: (1)
, (2)
and (3)
. As stated before,
cannot be evaluated by Mathematica for the last two cases. Thus, LogGamma[
z] appears as an extra result for
. The second column of
Table 9 displays the equation that was used to calculate the value of
. The label ‘c.c.’ denotes that the complex conjugate of the equation was used, which applies here because
is negative. The third column displays the actual values to 27 decimal places. We see that not only do the two different MB-regularized asymptotic forms agree with one another at each Stokes line, they also agree with the results obtained from the the Borel-summed asymptotic forms in (
58) and where possible, with the LogGamma routine in Mathematica.