Professional Documents
Culture Documents
TSOGTGEREL GANTUMUR
Contents
1. Taylor polynomials 1
2. Roundoff error analysis 4
3. The exponential function 6
4. Logarithmic functions 8
5. Trigonometric functions 11
6. Inverse trigonometric functions 15
7. Computation of π 15
1. Taylor polynomials
√
After the basic arithmetic and comparison operations, and the n-th root extraction n x,
the next important operations for real number computations are the evaluation of elementary
transcendental functions such as exp x, log x, sin x, and arctan x. Each of these functions can
be represented as a power series, which yields an efficient way to approximately evaluate the
function. In fact, the discovery or power series in the 17-th century led to a huge leap in the
computational capability of humans.
Let us start by fixing some terminology.
Definition 1. A function f ∶ (a, b) → R is called analytic at c ∈ (a, b) if it is developable into
a power series around c, i.e, if there are coefficients an ∈ R and r > 0 such that
∞
f (x) = ∑ an (x − c)n , for all x ∈ (c − r, c + r). (1)
n=0
Moreover, f is said to be analytic in (a, b) if it is analytic at each c ∈ (a, b).
Remark 2. (a) This definition can be extended to complex valued functions f ∶ Ω ⊂ C → C
in a straightforward way.
(b) Power series can be differentiated term-wise, implying that the coefficients of the power
series of f about c are given by an = f (n) (c)/n!. In other words, if f is analytic at c, then
the following Taylor series converges in a neighbourhood of c.
∞
f (n) (c)
f (x) = ∑ (x − c)n . (2)
n=0 n!
This formula was first published by Brook Taylor in 1715, although it was known previ-
ously to several mathematicians, including James Gregory as early as 1671.
Date: April 3, 2018.
1
2 TSOGTGEREL GANTUMUR
Example 3. (a) Arguably the most important power series is the geometric series
∞
1
= ∑ xn , (3)
1 − x n=0
which converges for all x satisfying ∣x∣ < 1.
(b) The next in line is perhaps
∞
xn
ex = ∑ , (4)
n=0 n!
which converges for all x ∈ R. This was discovered by Leonhard Euler in 1748.
Assume that (1) converges, and let
n
Tn (x) = ∑ ak (x − c)k , Rn (x) = f (x) − Tn (x), (5)
k=0
where Tn is called the n-th degree Taylor polynomial of f , and Rn is called the remainder.
The idea now is that in order to approximate f (x), we compute Tn (x) for some large n, such
that the remainder Rn (x) is small.
4 4
3 3
2 2
1 1
0 0
1 1
2.5 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.5 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5
We need a way to estimate the remainder term. The simplest case is when the series (1) is
alternating, in which case we have
∣Rn (x)∣ ≤ ∣an+1 (x − c)n+1 ∣. (6)
This is in fact approximately true in general, as the following theorem shows.
Theorem 4 (Lagrange 1797). Let f ∈ C ([c, x]) be n + 1 times differentiable in (c, x), with
the n-th derivative f (n) continuous in [c, x). Then there exists ξ ∈ (c, x), such that
f (k) (c)
n
f (n+1) (ξ)
f (x) = ∑ (x − c)k + (x − c)n+1 . (7)
k=0 k! (n + 1)!
Proof. The case n = 0 is simply the mean value theorem. We will give a proof only for the
case n = 1, which contains all essential ideas of the general case.
We look for a quadratic polynomial q(z) = α + β(z − c) + γ(z − c)2 satisfying
q(c) = f (c), q(x) = f (x), and q ′ (c) = f ′ (c), (8)
POWER SERIES 3
and arrive at the exponential series (4). Show that the series converges for all x ∈ R.
Exercise 2. Show that the binomial series
a(a − 1) 2 a(a − 1)(a − 2) 3
(1 + x)a = 1 + ax + x + x + ..., (18)
2! 3!
converges for ∣x∣ < 1, where a ∈ R is a constant.
4 TSOGTGEREL GANTUMUR
Exercise 3 (Cauchy’s form of the Taylor remainder). In the setting of Theorem 4, show that
n
f (k) (c) f (n+1) (η)
f (x) = ∑ (x − c)k + (x − η)n (x − c). (19)
k=0 k! n!
for some η ∈ (0, x) or η ∈ (x, 0), depending on whether x > 0 or x < 0.
(36), but we would need to compute the power em in (37). On the other hand, the choice
b = 2 would lead to the simple power 2m in (37), but we would need a value of log 2 in (36).
The preceding method may be called an additive argument reduction. We can also approach
the argument reduction problem multiplicatively. Let r = x/n, where n is some large integer,
preferably of the form n = 2k . Then we have
ex = enr = (er )n , (38)
where er is to be computed with power series. If n = 2k , then the power (er )n can be computed
by repeated squaring, as in, e.g., (er )8 = (((er )2 )2 )2 .
Remark 7. Let us look at the roundoff error. We assume n = 2k , and that the division
r = x/n can be done exactly. Furthermore, suppose that z = er is computed with relative
precision η > 0, as
z̃ = er (1 + δ0 ), ∣δ0 ∣ ≤ η. (39)
POWER SERIES 7
4. Logarithmic functions
For logarithms, the basic power series is
∞
(−1)n−1 xn x2 x3 x4
log(1 + x) = ∑ =x− + − + ... (−1 < x ≤ 1), (57)
n=1 n 2 3 4
which was discovered independently by Gerardus Mercator and Isaac Newton around 1667.
The series only converges for −1 < x ≤ 1, and so we need argument reduction to compute log y
for arbitrary y > 0. To this end, let us perform the multiplicative reduction
y = r2n , so that log y = n log 2 + log r, (58)
where we require n ∈ Z and 1 ≤ r < 2, ensuring r = 1 + x with 0 ≤ x < 1. Note that we can
replace the condition 1 ≤ r < 2 by the more general ρ ≤ r < 2ρ, where ρ < 1 but ρ ≈ 1.
Further reduction is possible, by the recipe
√ √ √
√ ( 1 + x)(1 + 1 + x) 1+x+1+x
log(1 + x) = 2 log 1 + x = 2 log √ = 2 log √
1+ 1+x 1+ 1+x (59)
x
= 2 log (1 + √ ) =∶ 2 log(1 + z),
1+ 1+x
which can be applied repeatedly. Note that
x x
z= √ < for x > 0, (60)
1+ 1+x 2
√
and also that this form is numerically better behaved than the alternative z = 1 + x − 1.
POWER SERIES 9
Finally, once the problem is reduced to evaluating log(1 + z) with z small, we can resort to
the series
1 1 + x ∞ x2n+1 x3 x5 x7
log =∑ =x+ + + + ... (∣x∣ < 1), (61)
2 1 − x n=0 2n + 1 3 5 7
discovered by James Gregory in 1668. Solving 1+x1−x = 1 + z for x gives x = 2+z ≈ 2 , so not only
z z
the the “stepsize” of Gregory’s series is x2 as in Remark 9, but also the argument is about
twice as small as the argument of the corresponding Mercator series. However, note that as
in Remark 9, this reduction can only be used once.
Example 10. Note that we need an accurate value of log 2 for the reduction (58).
(a) Mercator’s series for log 2 is
1 1 1
log 2 = 2 − + − + . . . , (62)
2 3 4
whose convergence is extremely slow. We can also use
1 1 1 1 1
log 2 = − log = + + + + ..., (63)
2 2 2⋅2 2 3⋅23 4 ⋅ 24
which is much better.
(b) On the other hand, for Grogory’s series, 2 = 1+x1−x gives x = 3 , and hence we have
1
2 2 2 2
log 2 = + + + + ..., (64)
3 3⋅3 3 5⋅3 5 7 ⋅ 37
which is way faster.
(c) We do the reduction (59) once, to get
1
log 2 = 2 log (1 + √ ), (65)
1+ 2
and compute the latter logarithm by Gregory’s series, with
1
x= √ . (66)
3+2 2
Compared to b), the magnitude of x has almost been halved.
and ℓ(107 − 1) = 1, while Bürgi’s logarithm satisfies ℓ(108 ) = 0 and ℓ(108 + 104 ) = 10. Upon
consultation with Napier, Henry Briggs compiled large tables of logarithms around 1620, with
the normalization ℓ(1) = 0 and ℓ(10) = 1. This is of course the common logarithm with base
10. Essentially, the method they used is to pick a large number n, and compute the powers
xk = (1 + n1 )k , k = 0, . . . , (68)
after which, they set
ℓ(xk ) = k. (69)
Hence the name logarithm (logos – ratio, arithmos – number). It is easy to see that
log xk n log xk
k= = , (70)
log(1 + n ) log(1 + n1 )n
1
(b) Expanding each of the logarithms in log(1 + x) − log(1 − x) into Mercator’s series, derive
the series (61). Show that
1 1+x
arctanh x = log , (76)
2 1−x
where arctanh x is the inverse function of the hyperbolic tangent
sinh x ex − e−x
tanh x = = . (77)
cosh x ex + e−x
Exercise 8. Perform a roundoff error analysis of the argument reduction (59) applied k times.
Exercise 9. (a) Suppose that we want to compute log 2 by writing log 2 = log 23 + log 34 , and
employing Gregory’s series to the resulting two logarithms. Would this method be faster
than that described in Example 10(c)?
(b) Suggest fast methods to compute log 5 and log 7, in the spirit of (a).
(c) Suggest several methods to compute log 3, in the spirit of Example 10.
5. Trigonometric functions
Recall the well known Maclaurin series for the sine and cosine functions
∞
x2k+1 x3 x5 x7
sin x = ∑ (−1)k =x− + − + ... (x ∈ R),
k=0 (2k + 1)! 3! 5! 7!
∞
(78)
x2k x2 x4 x6
cos x = ∑ (−1) k
=1− + − + ... (x ∈ R).
k=0 (2k)! 2 4! 6!
Both series were discovered independently by Isaac Newton and Gottfried Leibniz during the
period 1669–1676. It turns out that this was a rediscovery, in that the series (78) appeared
in the writings of early 16-th century Indian mathematicians, who attributed the discovery
to Madhava of Sangamagramma. Unfortunately, their knowledge was not widespread, and
apparently had no influence on the development of calculus in Europe.
The fundamental properties of these functions are periodicity
sin(x + 2πn) = sin x, cos(x + 2πn) = cos x, n ∈ Z, (79)
symmetry
sin(−x) = − sin x, cos(−x) = cos x, (80)
and the law of addition
sin(x + y) = sin x cos y + cos x sin y,
(81)
cos(x + y) = cos x cos y − sin x sin y.
Their interrelations are summed up in
sin2 x + cos2 x = 1, and cos x = sin( π2 − x). (82)
Thus by periodicity and symmetry, the arguments of both functions sin x and cos x can be
reduced to the case 0 ≤ x < π2 . This makes the series alternating, which means straightforward
remainder estimates. Moreover, the law of addition implies the double angle formulas
sin 2x = 2 sin x cos x, cos 2x = cos2 x − sin2 x, (83)
which in turn give us the following argument reduction recipes
√
sin x = 2 sin( x2 ) 1 − sin2( x2 ),
(84)
cos x = 2 cos2( x2 ) − 1.
12 TSOGTGEREL GANTUMUR
Remark 12 (Tangent series). In view of (82), we only need to be able to compute either sin x
or cos x, and all the other functions tan x, cot x, sec x, and csc x can be expressed in terms of
a single function. However, other series may be of independent interest. For instance, take
the tangent series
∞
t2k+1 x2k+1 t3 x3 t5 x5 t7 x7
tan x = ∑ = t1 x + + + + ... (∣x∣ < π2 ), (85)
k=0 (2k + 1)! 3! 5! 7!
where t1 = 1, t3 = 2, t5 = 16, t7 = 272, etc., are positive integers, called the tangent numbers.
These numbers are related to the Bernoulli numbers by
2n
B2n = (−1)n 2n t2n−1 , n = 1, 2, . . . . (86)
4 − 22n
To compute the tangent numbers, note that
t2k+1 = (tan x)(2k+1) ∣x=0 . (87)
It is immediate from
(tan x)′ = 1 + tan2 x, (88)
that (tan x)(n) is a polynomial in tan x, of degree not exceeding n + 1. Then by writing
(tan x)(n) = an,0 + an,1 tan x + . . . + an,n+1 tann+1 x
= an−1,1 (tan x)′ + . . . + an−1,n (tann x)′ (89)
= an−1,1 (1 + tan2 x) + . . . + nan−1,n tann−1 x(1 + tan2 x),
we derive the recurrence relation
an,j = (j − 1)an−1,j−1 + (j + 1)an−1,j+1 , (90)
with the understanding that an−1,j = 0 for all j < 0 and j > n. Thus starting with a0,j = δ1,j ,
we can compute the coefficients an,j , and then set t2k+1 = a2k+1,0 . An attractive feature of this
algorithm is that all operations are over positive integers. Table 3 illustrates the algorithm.
Table 3. Computation of the tangent numbers, cf. (90).
n=0 0 1
n=1 1 0 1
n=2 0 2 0 2
n=3 2 0 8 0 6
n=4 0 16 0 40 0 24
n = 5 16 0 136 0 240 0 120
n = 6 0 272 0 136 0 1680 0 720
n = 7 272 0 272+3⋅136 0 3⋅136+5⋅1680 0 5⋅1680+7⋅720 0 7⋅720
We end this section with a couple of historical remarks, summarizing the computational
methods for trigonometric functions that existed before power series.
Remark 13 (Using square roots only). Trigonometric functions have been around much
longer than logarithms, since the times of ancient Greeks. While the Greeks only used the
chord function
chord x = 2 sin x2 , (91)
explicitly, 5-th century Indian mathematicians introduced sin x, cos x, arcsin x, and others.
Let us try to compute the exact value of cos x for as many values of x as possible. Thus, the
sine series (78), in combination with (82), implies
cos π2 = sin 0 = 0, sin π2 = cos 0 = 1. (92)
POWER SERIES 13
Remark 14 (More general methods). In view of the preceding remark, the classical Greeks
π
could not get an acceptable exact answer for chord 360 = 2 sin 720
π π
. The value chord 480 was
accessible, and so Claudius Ptolemy invoked the approximation chord x ≈ x for x ≈ 0, to find
π
chord 360 ≈ 4
3
π
chord 480 , (104)
and used bisection and the law of addition to compute chord x for x = 720π 3π 4π
, 720 , 720 , . . ., result-
ing in a table with 3 hexagesimal digits of accuracy. From our perspective, what Ptolemy does
is an argument reduction that ensures ∣x∣ ≤ 720
π
, followed by the “power series” approximation
sin x ≈ x. Notice the similarity with Briggs’ method, cf. Remark 11, both in the repeated
use of square root extractions in the argument reduction, and in the simplicity of the final
approximation. Ptolemy’s method was taken to the extreme by the early renaissance schol-
ars, such as Regiomontanus (1436–1476), who computed the sines for every minute, with 7
decimals, and Rheticus (1514–1574), who produced, e.g., a table of sines for every 10”, with
the accuracy of 10 decimals.
On the other hand, around 650, Bhaskara I gave the excellent approximation
π 2 − 4x2
cos x = + E(x), (105)
π 2 + x2
which (we now know) satisfies the error bound ∣E(x)∣ ≤ 0.002 for ∣x∣ ≤ π2 . It appears that the
continued attempts to improve this formula by the medieval Indian mathematicians culmi-
nated in the discovery of power series by Madhava.
Starting with digit-by-digit algorithms for extracting square and cubic roots, medieval
Indian, Chinese, and Islamic mathematicians developed iterative algorithms for solving poly-
π
nomial equations. Thus, Al-Kashi (c. 1420) solved the cubic (96) for cos x, to trisect 120 , and
π
computed cos 360 with 9 hexagesimal digits of accuracy. In an apparently independent devel-
opment, François Viète (c. 1600) discovered iterative procedures to solve polynomial equations
associated to dividing an angle into 3, 5, and 7 equal pieces. Note that the solution of general
cubics, exposed in 1545 by Gerolamo Cardano, means that angle trisection was possible by
that time, if one allows cubic root extractions. Further research in iterative methods eventu-
ally led to the discovery of the Newton-Raphson method by Henry Briggs, Isaac Newton, and
Joseph Raphson. Briggs applied his iterative method to compute trigonometric functions of
very small angles, which served as the basis for his famous trigonometric tables. It appears
that Briggs discovered the Newton-Raphson method well before the birth of either Newton
or Raphson. Finally, we must mention Jost Bürgi, who discovered (c. 1592) an ingenious
iterative method that produces an entire table of sine at once.
Exercise 10. Look for a function f satisfying f ′′ (x) + f (x) = 0 in the form
∞
f (x) = ∑ an xn . (106)
n=0
(a) Putting f (0) = 0 and f ′ (0) = 1, arrive at the sine series in (78). Show that the series
converges for all x ∈ R.
(b) Putting f (0) = 1 and f ′ (0) = 0, arrive at the cosine series in (78). Show that the series
converges for all x ∈ R.
Exercise 11. Perform a roundoff error analysis of the argument reduction (84) applied k
times.
Exercise 12. Come up with an argument reduction formula for tan x, and design an algo-
rithm to compute tan x in the Ptolemy-Briggs style, that performs the argument reduction
sufficiently many times, before invoking tan x ≈ x.
POWER SERIES 15
7. Computation of π
At the risk of deviating a bit from the main subject, as an interesting case study, we include
here a brief historical review on methods to compute the digits of π, up to and including the
point when power series dominated the field.
The first rigorous method to compute π is due to Archimedes of Syracuse, c. 250 BC.
He approximated the circumference of a circle by using inscribed and circumscribed regular
polygons with 6, 12, 24, 48, and finally 96 sides, to conclude
71 < π < 3 7 ,
3 10 1
(113)
10
where we note that 3 71 = 3.1408 . . . and 3 17 = 3.1428 . . .. To add a bit more detail, it is easy to
see from Figure 2 that the perimeter of the regular n-gon inscribed in the unit circle is 2n sin nπ ,
and the perimeter of the regular n-gon circumscribed about the unit circle is 2n tan nπ , yielding
n sin πn < π < n tan πn . (114)
16 TSOGTGEREL GANTUMUR
π 1 π
2n n
1
pn pn
p2n p0n
From our perspective, this is immediate because sin x < x < tan x for 0 < x < π2 . To compute
π
sin 96 , Archimedes used the recurrence formula displayed in Figure 2(a), or equivalently
sin 2α sin 4α sin 16α
sin α = = = ... = 4 , (115)
2 cos α 22 cos α cos 2α 2 cos α cos 2α cos 4α cos 8α
with α = 96
π
, in combination with the angle bisection technique (94) for the cosines, cf. the
values (99). Note that sin 16α = sin π6 is available. In the end, we get bounds such as
π 2
1< < √ = 1.1547 . . .
3 3
√ √
π 2+ 3 2
1< ⋅ < √ √ = 1.0352 . . .
3 2 2+ 3 (116)
√ √ √ √ √
π 2+ 3 2+ 2+ 3 2
1< ⋅ ⋅ < √ √ √ = 1.0086 . . . .
3 2 2
2+ 2+ 3
This algorithm leads to the infinite product expansion
√ √
√ √ √ √ √ √ √
3 2+ 3 2+ 2+ 3 2+ 2+ 2+ 3
= ⋅ ⋅ ⋯, (117)
π 2 2 2
although Archimedes would be extremely reluctant to consider such things.
Until the invention of calculus, the Archimedes algorithm and its variations were the only
methods available for computing the digits of π. Thus Ptolemy used his accurate trigonometric
table to compute the perimeter of the inscribed 360-gon, and deduced
π ≈ 3 120
17
= 3.14166 . . . . (118)
Around 250, independently of Archimedes, Liu Hui developed an algorithm based on the areas
of inscribed and circumscribed polygons, and replaced (114) by the slightly improved version
n sin πn < π < n sin πn + dn , where dn = n sin πn − n
2 sin 2π
n . (119)
POWER SERIES 17
Note that
π
2n sin 2n = n sin πn + d2n , π
4n sin 4n = n sin πn + d2n + d4n , (120)
etc. He then observed
d2n ≈ 41 dn , (121)
so that the right hand side of
π = n sin πn + d2n + d4n + . . . ≈ n sin πn + (1 + 1
4 + ( 14 )2 + . . . )d2n = n sin πn + 43 d2n , (122)
would be more accurate than the simple update 2n sin = n sin + d2n . Liu Hui tried his
π
2n
π
n
accelerated method on a 192-gon, which gave the same accuracy as that of the non-accelerated
method on a 3072-gon. This is a precursor to the modern acceleration techniques.
In 1579, François Viète derived the formula
√ √ √ √ √ √ √
√ √ √
2 2 2+ 2 2+ 2+ 2 2+ 2+ 2+ 2
= ⋅ ⋅ ⋅ ⋯, (123)
π 2 2 2 2
by modifying the Archimedes algorithm to start with a square, instead of a hexagon, cf. (117).
This beautiful formula is considered to be the dawn of modern mathematics, as it was the
first ever explicit occurrence of an infinite process in mathematics.
Table 4 lists some of the notable progress achieved with the help of Archimedean algorithms.
The last and most impressive of the more straightforward computations were done by Ludolph
van Ceulen, when he used a polygon of 262 sides, to derive
π = 3.14159265358979323846264338327950288 . . . . (124)
In order to explain how the final accuracy depends on the number of sides of the polygon
used, we note that
π3 1 π3 1
n sin πn = π −2
+ O( 4
), n tan π
n = π + 2
+ O( 4 ). (125)
6n n 3n n
Neglecting the higher order term, we see that doubling n would reduce the error roughly 4
times, i.e., going from n to 2n would add log10 4 ≈ 0.6 correct decimal digits. For instance,
from van Roomen’s computation (n = 230 ) to van Ceulen’s computation (n = 262 ), there are
32 doublings of n, which nicely explains why van Ceulen has 18 ≈ 0.6 ⋅ 32 additional correct
decimal digits.
18 TSOGTGEREL GANTUMUR
From Table 4, we see that Willebrord Snell had a success comparable to van Ceulen’s
by using a polygon with “only” 230 sides. This is because he observed that the particular
combination 32 n sin πn + 13 n tan πn of the perimeters of the inscribed and circumscribed polygons
converges faster than either of the perimeters. A mathematical explanation was given by
Christiaan Huygens in 1654. From our perspective, the expansions (125) immediately yield
1
2 π
3 n sin n + 13 n tan πn = π + O(
). (126)
n4
Hence Snell’s method converges twice as fast, in the sense that doubling n adds approximately
1.2 correct decimal digits. For instance, Snell was able to squeeze out 7 correct decimal digits
from Archimedes’ 96 sided polygon. It is also easy to see that Liu Hui’s accelerated formula
(122) has the same quality:
1 π3 1
n sin πn + 43 d2n = π + O( ), because d2n = + O( 4 ). (127)
n4 8n 3 n
Just before the advent of power series, John Wallis discovered the noteworthy formula
2 1 3 3 5 5 7 7 9
= ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋯, (128)
π 2 2 4 4 6 6 8 8
which was modified by William Brouncker into the continued fraction
4 1
=1+ . (129)
π 9
2+
25
2+
49
2+
2+⋯
Both formulas were published in 1655, and π was computed to a few decimal places. However,
these formulas converge too slowly to have any practical utility.
We now turn to power series. The arctangent series (107) gives the nice looking formula
π 1 1 1
= arctan 1 = 1 − + − + . . . , (130)
4 3 5 7
POWER SERIES 19
but its convergence is again incredibly slow. For instance, to get an accuracy of 9 decimal
digits, one needs to sum a billion terms. A better option is to use the relation tan π6 = √1 ,
3
which yields
π 1 1 1 1 1 1 1
= √ (1 − ⋅ 2 + ⋅ 4 − ⋅ 6 + . . . ). (131)
6 3 3 3 5 3 7 3
This was in fact used by Madhava to reach 11 decimal digits of accuracy.
In 1665, Isaac Newton used the expansion
√
π 3 1/4 √
− =∫ x(1 − x)dx
24 32 0
(132)
1 1 1 1 (2n − 3)!!
= − 5 − 9 − 13 − . . . − 3n+2 − ...,
12 2 ⋅ 5 2 ⋅ 7 2 ⋅ 9 2 n!(2n + 3)
to compute π to 16 decimals.
Then van Ceulen’s record was finally broken by Abraham Sharp in 1699, when he computed
71 decimal digits of π. He used the
√ series (131), as well as its variations based on other known
values of tan x, such as tan π8 = 2 − 1.
The next advance came in 1706, when John Machin used the formula
π 1 1
= 4 arctan − arctan , (133)
4 5 239
to cross the 100 decimals mark. This formula is remarkable, because the powers of 15 are
1
easily computed in base 10, and the series for arctan 239 converges very rapidly. Since then,
a wealth of similar formulas have been discovered. For example, we have
π 1 3
= 5 arctan + 2 arctan , (134)
4 7 79
due to Jurij Vega and Leonhard Euler (c. 1780), and
π 1 1 1
= 12 arctan + 8 arctan − 5 arctan , (135)
4 18 57 239
due to Carl Friedrich Gauss (1863). Table 6 illustrates some of the aforementioned power
series methods for computing π in action.
Table 6. Performance of power series formulas for π. Note that Gauss’ for-
mula saturates the machine arithmetic beyond 6 terms.
In Table 7, we list some of the historic computations. Perhaps the last great manual com-
putation of π was that of William Shanks. He went back to Machin’s formula (133), and
20 TSOGTGEREL GANTUMUR
computed 707 decimal digits, but it was later discovered that “only” 527 of them were cor-
rect. In the early days of the electronic computer era, it must have been difficult to resists
the temptation to see how many more digits of π the newly invented machines can produce.
In fact, computation of π became a standard test for new computers. As for the algorithms,
almost all computations up to the late 1970’s were done by employing Machin-like formulas.
For instance, the 100,000 decimals mark was first crossed by Daniel Shanks and John Wrench,
who used the Gauss formula (135), in combination with
π 1 1 1
= 6 arctan + 2 arctan + arctan , (136)
4 8 57 239
due to Carl Størmer (1896).
From the late 1970’s, more sophisticated algorithms, based on ideas such as Ramanujan se-
ries and arithmetic-geometric mean iterations dominated the scene, but power series methods
still remain competitive. This is evidenced by the record computation of Yasumasa Kanada
and his team, performed in 2002 to find 1.24 trillion decimal digits of π. They used the
Machin-like formulas
π 1 1 1 1
= 44 arctan + 7 arctan − 12 arctan + 24 arctan , (137)
4 57 239 682 12943
due to Størmer (1896), and
π 1 1 1 1
= 12 arctan + 32 arctan − 5 arctan + 12 arctan , (138)
4 49 57 239 110443
due to Kikuo Takano (1982).
Exercise 15. Prove Liu Hui’s upper bound (119) by showing that
sin 2x π
sin x < 2 sin x − for 0 < x < . (139)
2 2
To compare this with the Archimedes’ upper bound (114), show also that
sin 2x π
2 sin x − < tan x − sin x for 0 < x < . (140)
2 2
Exercise 16. For 0 ≤ a ≤ 1, show that
a√ 1 √
∫ x(1 − x)dx = ( π2 − arcsin b − b 1 − b2 ), where b = 1 − 2a. (141)
0 8
√
Then expanding the factor 1 − x in the integrand by the binomial theorem (18), termwise
integrating the resulting series, and finally putting a = 14 , prove Newton’s formula (132).