Skip to main content
Mathematics and computation

Mathematics and computation

Computational ‘pathology’ could hamper climate and fusion simulations

26 Sep 2019
Floating point
Devilish pathology: researchers have found a new problem with how floating-point calculations are done. (Courtesy: iStock/loops7)

Scientists who think they have accurately modelled chaotic systems on their computers may need to think again. Researchers in the US and UK have uncovered a “pathology” affecting floating-point arithmetic that introduces significant errors when describing systems that are extremely sensitive to their initial conditions. Simulations that could be affected range from those trying to describe turbulence inside fusion reactors to models of the Earth’s climate.

Almost all digital computers represent numbers using the floating-point system. For each number, one bit reveals the number’s sign, several other bits encode its exponent and the rest are used for the mantissa (its significant digits). This is usually done at “single-precision” using 32 bits, or at “double precision”, which uses 64.

The new research investigates the effects of the discrete and uneven distribution of numbers that are characteristics of floating-point arithmetic. Because the quantity of numbers that can be represented by the mantissa remains the same between each successive step up or down in the value of the exponent, numbers will become more widely spaced the bigger they get. There are as many possible floating-point numbers between 0.5 and 1 as there are between 1 and 2, for example.

Extreme sensitivity

These properties of floating-point numbers pose a problem to the modelling of chaotic systems, owing to these systems’ extreme sensitivity to initial conditions. The value of a given physical parameter in the real world is far more unlikely to be a rational number – one that can be represented as a ratio of two integers – than an irrational one. And it is less likely still to be a number that can be represented by the floating-point scheme. This means that there will almost certainly be an error at the start of the computation, which will then be amplified.

To gauge just how bad the problem could really be, computational scientist Peter Coveney of University College London, together with mathematicians Bruce Boghosian and Hongyan Wang of Tufts University in Massachusetts, considered a very simple and idealized non-linear system – the Bernoulli map. This involves taking any value between 0 and 1, multiplying that number by a given factor, known as beta, and taking the remainder if the result of the multiplication is greater than or equal to 1. The operation is then repeated on the remainder, and so on. With beta=2, for example, 0.75 maps to 0.5, which then maps to 0.

Bernoulli breakdown

Scientists know that when beta is 2 the floating-point simulation of a Bernoulli map breaks down completely. Analytical mathematics shows that after a very large number of iterations over a very wide range of starting values there should be an equal probability of the system ending up at any value between 0 and 1. But that is because the vast majority of starting values are irrational numbers. Inside a digital processor the result always converges on 0 – as with the above example of the rational number 0.75 (3/4).

Coveney and colleagues say this problem with beta=2 is usually considered a peculiar consequence of using a binary system, which is base 2. Now, however, they have shown that floating-point simulations of a Bernoulli map also fail when using other even integer values of beta. More worryingly, they have discovered that even non-integer beta values generate errors.

The researchers carried out their simulations on a small cluster computer at Tufts University with a range of beta values. In each case they mimicked as closely as possible an infinite ensemble of starting points between 0 and 1 and an infinite number of iterations in time. They found that, although less severe than for beta=2, the simulations still generated errors of around 10% when compared with the expected results from analytical calculations.

Insidious errors

“The problem here is that most people have no idea that those errors exist,” says Coveney, who describes the errors as “insidious” because the modelling results look plausible and provide no hint of a miscalculation. He adds that the errors are due to the nature of the floating-point representation, rather than a lack of precision. “Even quadruple precision wouldn’t make any difference,” he says. “That’s not going to remove this problem.”

According to Coveney, this problem could affect simulations of a wide range of chaotic systems – from the molecular dynamics of protein folding, which informs drug development, to fusion plasmas, which are very turbulent. He says that weather forecasting and climate modelling could also be affected. Keen not to be too specific about the implications for understanding the climate, he says that some parts of climate models could contain errors “of a similar magnitude to the errors you thought you had”.

Writing in Advanced Theory and Simulations, the researchers point out that the Bernoulli map is too simplistic to reproduce many of the features seen in real chaotic systems, such as subtle correlations in turbulent fluid flow. But they argue that modellers should not draw any comfort from this fact. “Rather,” they say, “we would suggest that if so simple a system exhibits such egregious pathologies, a more complex system will probably exhibit even more devilish ones”.

Shujun Li, a computer scientist at the University of Kent in the UK who has also studied digital representations of chaotic systems, says he finds the new work “interesting but not surprising”. He argues that this and previous research show that the limitations of floating-point arithmetic could have implications beyond academic modelling. One such area, he suggests, is cyber security. Many chaos-based cryptosystems, he says, “are often not secure or at least [there is] no easy proof to guarantee they are secure”.

Copyright © 2024 by IOP Publishing Ltd and individual contributors