Reliable Computing 10: 489–500, 2004.
2004 Kluwer Academic Publishers. Printed in the Netherlands.
Spigot Algorithm and Reliable Computation
of Natural Logarithm
Dresden University of Technology, Department of Computer Science, Institute of Theoretical
Computer Science, Dresden, Germany, e-mail: firstname.lastname@example.org
(Received: 13 January 2003; accepted: 10 December 2003)
Abstract. The spigot approach used in the previous paper (Reliable Computing 7 (3) (2001), pp. 247–
273) for root computation is now applied to natural logarithms. The logarithm ln Q with Q
is decomposed into a sum of two addends k
, then each of them is
computed by the spigot algorithm and summation is carried out using integer arithmetic. The whole
procedure is not literally a spigot algorithm, but advantages are the same: only integer arithmetic is
needed whereas arbitrary accuracy is achieved and absolute reliability is guaranteed. The concrete
procedure based on the decomposition ln Q = k
ln 2 + ln (1 +
) with p
simple and ready for implementation. In addition to the mentioned paper, means for determining an
upper bound for the biggest integer occurring in the process of spigot computing are now provided,
which is essential for the reliability of machine computation.
The history of the spigot approach to computing, its advantages, and its formal-
ization were dealt with in , where an application for root computing was also
developed. The goal of this paper is to apply the spigot approach to computing
natural logarithms of rational numbers. For understanding the spigot approach,
please refer to Section 2 of  for nested expressions and their manipulations.
The main idea for computing ln Q is to decompose it into k
compute each addend by spigot algorithm, and sum the results. In Section 2 a con-
crete procedure based on the decomposition ln Q = k
ln 2 + ln
developed where results are represented in the usual decimal system; this procedure
is summed up in Deﬁnition 2.3. Possible ways for improving efﬁciency and open
questions are discussed in Section 3. The investigation of ﬁnding an upper bound
for the biggest integer occurring in the computation in Section 2.4, as a means for
avoiding arithmetic overﬂow, represents a new aspect of spigot algorithm ﬁrst dealt
with in this paper.
We now express some formalisms reﬂecting the process of summing two results
of the spigot algorithm in order to show that it is also done by integer arithmetic.