September 15, 1997

(Modified April 20, 2000)

When numerically iterating the logistic equation

*X _{n}*

round-off errors can cause spurious results. Consider the case
*A*
= 4 which maps the unit interval (0, 1) back onto itself exactly twice.
Because of the shape of the parabolic logistic function, many values of
*X _{n}*
near 0.5 map into values of

Suppose that the logistic equation with *A*
= 4 is iterated using (4-byte) single-precision arithmetic. Four
bytes is 32 bits, of which 23 are used for the mantissa, 8 for the exponent,
and 1 for the sign according to the IEEE standard for floating point arithmetic.
Thus the computer can represent 2^{23} = 8,388,608 unique values
in the range (0, 1) for a given exponent. Values near zero can be
represented more accurately by changing the exponent. Thus the problem
occurs for values of *X _{n}*

*X*^{2} - *X* + 1/4 - 2^{-26} = 0

which has solutions *X* = 0.5 ± 2^{-13}. Thus
the region of the interval (0, 1) over which *X _{n}*
is an eventually fixed point is of width 2

*P* = 1 / pi[*X*(1 - *X*)]^{1/2}

which has a value of *P* = 2 / pi = 0.637 for *X* = 0.5, the
probability that an iterate will fall within the region above is 1.55 x
10^{-4}. Thus on average, we would expect the reciprocal
of this number of iterates before the fixed point at zero is reached, or
*N*
= 6400.

To test this prediction, the logistic map was iterated in single precision many times using a uniform random initial condition in (0,1), and the number of iterations required for zero to be reached was determined. The source and object code used for this test are available. Typical results follow:

- Solution reached 0 after 3334 iterations - Average = 1981 - Cases =
989

Solution reached 0 after 1082 iterations - Average = 1980 - Cases = 990

Solution reached 0 after 3153 iterations - Average = 1981 - Cases = 991

Solution reached 0 after 4017 iterations - Average = 1984 - Cases = 992

Solution reached 0 after 2941 iterations - Average = 1985 - Cases = 993

Solution reached 0 after 2581 iterations - Average = 1985 - Cases = 994

Solution reached 0 after 1183 iterations - Average = 1984 - Cases = 995

Solution reached 0 after 3890 iterations - Average = 1986 - Cases = 996

Solution reached 0 after 2604 iterations - Average = 1987 - Cases = 997

Solution caught in a periodic cycle

Solution reached 0 after 3136 iterations - Average = 1988 - Cases = 998

Solution reached 0 after 542 iterations - Average = 1987 - Cases = 999

Solution reached 0 after 2082 iterations - Average = 1987 - Cases = 1000

Solution reached 0 after 927 iterations - Average = 1986 - Cases = 1001

Solution reached 0 after 1984 iterations - Average = 1986 - Cases = 1002

Solution reached 0 after 538 iterations - Average = 1984 - Cases = 1003

Solution caught in a periodic cycle

Solution reached 0 after 297 iterations - Average = 1982 - Cases = 1004

Solution reached 0 after 3455 iterations - Average = 1984 - Cases = 1005

Solution reached 0 after 2529 iterations - Average = 1984 - Cases = 1006

Solution reached 0 after 2051 iterations - Average = 1985 - Cases = 1007

Solution reached 0 after 1509 iterations - Average = 1984 - Cases = 1008

Solution reached 0 after 1056 iterations - Average = 1983 - Cases = 1009

Solution reached 0 after 2723 iterations - Average = 1984 - Cases = 1010