Reliable Computing 7: 247–273, 2001.
2001 Kluwer Academic Publishers. Printed in the Netherlands.
Spigot Algorithm and Root Computing
Dresden University of Technology, Department of Computer Science, Institute of Theoretical
Computer Science, Chair of Theory of Algorithms and Automates, Dresden, Germany,
(Received: 23 November 1999; accepted: 27 June 2000)
Abstract. The word spigot indicates that the “digits” (generally in a widened meaning) of the result
number are extracted successively from left to right (as if pumped through a spigot) by using only
integer arithmetic, as opposed to the iterative approach, where the result number as the whole is
improved after each iteration step by using (high-precision) ﬂoating-point arithmetic. The approach
of spigot computing as used in papers by S. Kamal Abdaly (Comm. ACM 13 (1970)), S. Rabinowitz
and S. Wagon (American Mathematical Monthly 102 (3) (1995)), A. H. J. Sale (Comput. J. 11 (1968))
is now systematized and correctness is formally proved; the way for achieving an arbitrary accuracy
Then a method for computing roots of arbitrary rational numbers is developed. If a root is
not rational, spigot approach is used to compute its decimal approximation with an arbitrary given
accuracy; if the root is rational, its numerator and denominator are computed exactly. This method for
root computing is absolutely reliable; it is both formally proved and tested by numerical examples.
The idea of spigot computing was introduced to me by Stoschek through the paper of
Rabinowitz and Wagon , where the digits of
were computed. Spigot approach
has the advantage of computing with arbitrary accuracy using only arithmetic on
small integers, which makes the result of computing absolutely reliable. For a given
required accuracy, the ‘digits’ (see the text after Deﬁnition 2.9) of the result number
are extracted successively from left to right, where the already computed ‘digits’
are not needed for further computing. Because of these beautiful properties the
formalization and generalization of spigot approach in order to make it ready for
computing further (class of) numerical values are of interest and investigated in this
paper. The results are:
1. The formalization of spigot algorithm in Deﬁntion 2.9; its correctness in The-
orem 2.1; and its typical application for computing the digits of a ﬁnite sum of
rational numbers in (2.6).
2. An approach for computing the digits of a real number with series expansion
using spigot algorithm through the equations (2.7) and (2.9); together with the
With thanks to my supervisor, Professor Stoschek, who introduced the idea of spigot algorithm
to me through the paper of Rabinowitz and Wagon .