An error that grows like a random walk
Assumes Numerical integration and Chaos.
Everything published about the long-term stability of the solar system rests on numerical integrations that run for billions of years and take billions of steps. The obvious question about such a calculation is what its error is, and the obvious answer — make the step smaller until the answer stops changing — is wrong in a way that is not obvious at all.
Below a certain step size, making the step smaller makes the answer worse. The step at which that happens is not far from the step such integrations actually use, and the reason is that there are two errors rather than one.
It is worth putting a number on the scale of the problem before analysing it. An integration of the outer solar system over five billion years at a step of a few hundred days takes of order steps. Every step performs perhaps a hundred floating-point operations per body, so the calculation performs something like roundings, each losing about a part in . If those losses added up in the worst possible way the accumulated error would be a factor of ten larger than the quantity being computed; if they add up in the best possible way — as a random walk — the total is three parts in . The entire difference between a meaningful result and a meaningless one lies in which of those two happens, and it is decided by details of the arithmetic that no equation in celestial mechanics mentions.
Two errors with opposite signs of slope
Truncation error is what the method gets wrong because it is an approximation. A method of order commits an error per step proportional to , and over steps that accumulates to something proportional to . Halving the step divides it by — a clean, predictable gain, and the whole reason higher-order methods exist.
Round-off error is what the arithmetic gets wrong because a real number is stored in a finite number of bits. Every addition of a small increment to a large coordinate loses the bits that fall off the bottom, and the loss is of order the machine epsilon times the magnitude of the number — about in double precision. That error per step does not depend on the step size at all, so a smaller step means more steps and more losses.
The way those losses accumulate is the crux. If the rounding is unbiased — as likely to go up as down — the losses are independent random increments and their sum is a random walk, growing as the square root of the number of steps. The number of steps is , so the total round-off error grows as : it rises as the step falls.
The sum of a falling power and a rising one has a minimum, and its position depends on the order of the method. Higher order shifts the minimum to a larger step and lowers it, which is a second and less-discussed reason to use a high-order method: not to take fewer steps, but to be allowed to.
One more feature of the minimum is worth noticing: it is not sharp. The total error near its optimum varies slowly, because it is the sum of two power laws crossing at a shallow angle, so a step size within a factor of three of the optimum costs very little. That is fortunate, since the optimum depends on the length of the run, on the machine’s precision and on the problem’s dynamic range, none of which is known exactly in advance. The practical procedure is not to find the optimum but to stay comfortably to the right of it, and to check afterwards that the energy error grew as a square root rather than linearly — which is a measurement of whether the arithmetic regime was the intended one.
Brouwer’s law, and why the exponents are what matter
Fixing the step and asking how the error grows in time gives a second and sharper statement, and it was made by Dirk Brouwer in 1937 for exactly this purpose.
An unbiased error in the energy performs a random walk, so it grows as . An error in the energy is an error in the mean motion, and an error in the mean motion integrates once more into an error in the position along the orbit. The double integral of a random walk grows as .
A biased error behaves differently at both stages. A rounding rule that always goes the same way, or a truncation error that does not average out over an orbit, accumulates linearly: the energy error grows as and the position error as .
The practical target that follows is called Brouwer’s law, and a solar-system integrator is said to achieve it when its energy error grows as rather than as . Achieving it is not automatic. It requires that the truncation error average to zero over an orbit, which is what a symplectic method guarantees, and that the round-off be unbiased, which requires care with the arithmetic.
There is a subtlety in the second step of that argument that is worth spelling out, because it explains why position errors are so much larger than energy errors in practice. An error in the energy is an error in the semi-major axis, and by Kepler’s third law an error in the semi-major axis is an error in the period. A body whose period is wrong by one part in drifts one part in of a revolution per revolution, and the drift accumulates: after orbits it is times as large. That is why the position error carries an extra power of time compared with the energy error, and it is why a beautifully conserved energy is not by itself evidence that a computed position means anything. An integrator can be right about how much and wrong about where, and this is the arithmetic reason as well as the structural one.
The tricks that make the rounding unbiased
Three techniques do most of the work, and each addresses a different way the arithmetic goes wrong.
Compensated summation. The classic loss is adding a small increment to a large accumulator: the low bits of the increment fall off the end and are gone. Kahan’s algorithm keeps a running record of what was lost and adds it back on the next step. It costs three extra floating-point operations per addition and it converts a linear accumulation into a random walk — which is to say it buys a change of exponent rather than a change of coefficient.
Storing the increment rather than the coordinate. A planet’s position is a large number and its change per step is a small one, so representing the state as an initial position plus an accumulated offset keeps the additions between numbers of similar size. The same idea appears in every long-baseline timing problem, and the reason is always the same: precision is relative, so the arithmetic should be done on quantities that are small.
Rounding that does not favour a direction. The default round-to-nearest with ties-to-even is very nearly unbiased, and that is not an accident of the standard; it was chosen for this. Truncation towards zero, which some older hardware did, is biased and destroys Brouwer’s law immediately.
None of the three tricks is exotic and all three are routinely omitted. A code written without them is not obviously wrong: it passes short tests, converges under step refinement over the range anybody checks, and conserves energy well over a thousand orbits. It fails only at durations long enough that nobody has an independent answer to compare against, which is precisely the regime the code exists for.
What was actually measured
The results that these techniques exist to support are the long integrations of the solar system, and the checks on them are worth stating because they are the only available evidence that the answers mean anything.
The energy error is monitored and its growth exponent is measured. A good modern integration of the outer solar system over five billion years reports a relative energy error of order growing as the square root of time. The exponent is fitted from the run itself rather than assumed, and a run that shows linear growth is diagnosed as having a bug in its arithmetic rather than as being slightly less accurate.
Independent codes are compared. The two long-running programmes that established the chaotic behaviour of the inner planets used different integrators, different step sizes, different arithmetic and different machines, and they agree on the statistical properties of the outcome — the Lyapunov time of about five million years, and the small probability of Mercury’s eccentricity becoming large — while disagreeing completely on any individual trajectory. That disagreement is expected and is the subject of the expiry date on a prediction; the agreement on the statistics is the evidence that the arithmetic is not driving the result.
And the integration is checked against reality where it can be. A solar-system integration run backwards over a few thousand years reproduces recorded eclipses, and over a few million years reproduces the astronomical cycles recorded in sedimentary rock. The second check is the more remarkable: the periodicities of Earth’s orbital eccentricity and obliquity are imprinted in ocean-floor sediments, and matching a computed sequence to a measured one over tens of millions of years is a direct test of the integration’s phase.
One further check is available and is under-used: run the same integration forwards and then backwards, and see whether it returns to its starting point. A time-reversible method with exact arithmetic would return exactly; the failure to return measures the irreversible part of the error, which is precisely the round-off. It is a strong test because it requires no reference solution and no theory of what the answer should be, and it separates the reversible truncation error — which cancels — from the irreversible arithmetic one, which does not.
Why the order of the method is not the whole story
There is a temptation to read the first figure as an argument for the highest available order, and the temptation should be resisted for a reason that is specific to this subject.
A high-order method takes more force evaluations per step, and a force evaluation in an -body problem costs . So the comparison is between accuracy at fixed work rather than at fixed step, and the crossover depends on the accuracy required. For the accuracies that matter here — parts in over gigayears — high order wins comfortably, which is why the field settled on high-order symplectic schemes. For a short, coarse integration it does not.
More importantly, the order says nothing about the structure of the error. A high-order non-symplectic method has a smaller energy error than a low-order symplectic one over a few orbits and a larger one over a million, because one drifts and the other does not. Order is about the coefficient; symplecticity is about the exponent; and this essay is about a third thing, which is the arithmetic, and which is also about the exponent.
There is a further reason order alone is a poor guide, and it is about what the integration is for. A solar-system integration is not trying to follow one trajectory accurately; it is trying to sample the distribution of outcomes. What matters for that is whether the computed trajectory is a typical member of the family of true trajectories consistent with the uncertainties — a property called shadowing — rather than whether it is close to any particular one. A symplectic method with well-behaved arithmetic produces trajectories that shadow; a method with a secular energy drift produces trajectories that systematically leave the family, because a drifting energy is a drifting semi-major axis and the resonance structure a body encounters depends on where it is in the semi-major axis. The failure is not that the answer is imprecise. It is that the answer is a sample from the wrong distribution, and the resonances the body drifts through are the mechanism.
Where the picture stops
Three limits stand out, and the second is the one that recurs in practice.
The step cannot always be fixed. Everything above assumes a constant step, and a constant step is what makes a symplectic method symplectic. A close encounter requires a smaller step, and adapting the step destroys the property that made the method trustworthy. The standard resolutions — switching integrators near an encounter, or regularising the coordinates so that no small step is needed — are both ways of avoiding an adaptive step rather than of making one safe.
Chaos sets a horizon that no arithmetic reaches. With a Lyapunov time of five million years, an error of in the initial conditions is amplified to order unity in about two hundred million years. Beyond that no integration predicts a trajectory, however perfect its arithmetic, and the object of the calculation changes from a prediction to a statistical statement. Improving the arithmetic pushes the horizon out logarithmically, which is to say hardly at all.
And the model is not the solar system. An integration includes the eight planets, usually Pluto, sometimes the largest asteroids, a relativistic correction and a tidal term. The masses of the asteroids are uncertain at the per cent level and their number is large, and that uncertainty dominates the error budget of a modern ephemeris over centuries — far above anything in this essay. Perfect arithmetic on an imperfect model is a familiar way of being precisely wrong.
One more deserves its own sentence because it is the one that has grown in importance. Modern hardware is fast at operations that are not bit-reproducible: vectorised instructions reorder summations, fused multiply-add changes rounding, and a parallel reduction gives different results depending on how many threads ran. Each of those is harmless for an ordinary calculation and each of them can silently reintroduce a bias into a summation that was carefully arranged not to have one. The result is that a code that achieved Brouwer’s law on one machine may not on another, with no change to its source, and the only way to find out is to measure the growth exponent on the machine that will do the run.
Why an exponent is worth more than a coefficient
The recurring shape here is worth naming, because it appears in every long calculation.
An error’s coefficient is improved by working harder: a finer step, more digits, a better method. An error’s exponent is improved only by changing what kind of error it is. Converting a linear accumulation into a random walk is worth more than any amount of extra precision, because it changes how the error scales with the length of the run, and the run is the thing that is getting longer.
That is why Brouwer’s law is stated as a law about growth rather than about size. A code that achieves it can be run ten times longer for a factor of three in error; a code that does not gains a factor of ten. Over the durations these calculations now reach, that difference is the difference between a result and a rounding artefact.
The same logic governs the analytic side of the subject: a perturbation series that is asymptotic rather than convergent improves for a while and then gets worse forever, and knowing which regime a calculation is in matters far more than knowing its current error. Both halves of celestial mechanics are, in the end, about the shape of an error rather than its size.
End on what the whole apparatus is defending. The claim these integrations support is a claim about a real physical system: that the inner solar system is marginally unstable, that Mercury’s eccentricity performs a random walk driven by a resonance with Jupiter, and that there is a small but non-zero probability of a catastrophic outcome within the Sun’s remaining lifetime. That is a statement about the world, and it is supported entirely by arithmetic — there is no closed solution to appeal to and no observation that can be made on the relevant timescale. When the whole of the evidence for a physical claim is a number that came out of a machine, the properties of the machine’s arithmetic stop being a technical detail and become part of the argument.
Where the ladder goes next
Later rungs on this ladder start with regularisation — the change of variables that removes the singularity at a close encounter and lets a fixed step survive one, which is the transformation that turns a collision into a harmonic oscillator. The rung after that is the statistical question these integrations exist to answer: what it means to compute a probability from a system with one realisation, and how many integrations are enough.
What links here
Essays that link to this one from their own argument.
- A density model wrong by a factor of two spaceflight
- The discontinuity a patched conic hides spaceflight
The objects this essay names
Each one links to every other essay that touches it.
Brouwers lawCompensated summationEnergy driftError propagationFloating-pointRandom walkRound-off errorStep sizeSymplectic integratorTruncation error