A bound every answer satisfies
Worth reading first: The same program, twice · The order they are added in.
The same program, twice ends on a set of twenty-one distinct answers to one sum, and the natural next move is to reach for the bound. There is one, it is in every textbook on the subject, and for a sum of n floating-point numbers evaluated in any order it says
|ŝ − s| ≤ γₙ₋₁ · Σ|xᵢ|, γₙ = nu / (1 − nu).
The bound is correct. Every one of the twenty-six runs satisfies it — that is asserted on every build of this site rather than assumed, because a bound nobody has fed a counterexample is a bound nobody has tested. And it is nearly useless for the question the previous essay ends on, for a reason that is worth stating carefully, because it is the reason this field is not a subsection of the arithmetic one.
Three curves. Two of them are the same curve times a constant, and the third — the only one that is published — is nearly four orders above both.
What the bound is a statement about
Read the right-hand side. It contains n, the number of terms, and Σ|xᵢ|, the sum of their magnitudes. It does not contain the order.
That is not an oversight. The bound is derived by taking the worst case over every rounding the computation might commit, and the worst case is the same whichever order the terms arrive in — so the bound is a single number covering the whole family of orderings at once. It is a statement about the family.
The question a reader has after the previous essay is about one member of it. This run returned 1.0000000019790605; will the next one? A statement true of every member cannot separate two members, and no amount of tightening changes that: a tighter bound over all orderings is still one number for all of them.
This is the same distinction three walks and one bound draws in the arithmetic field, from the other side. There, three unrelated computations each have a standard bound linear in what they accumulate against, and all three attain a half of it — the bound is loose by a factor that is itself a measurement. Here the looseness is worse and the mismatch is different in kind: the quantity a reader wants is not smaller than the bound, it is a different quantity.
How much looser, measured
On the hero figure’s default vector, with 2,048 terms:
| quantity | value at κ = 10⁸ |
|---|---|
| the measured spread between seven reductions | 5.6·10⁻⁹ relative |
| κ · u | 2.2·10⁻⁸ |
| the classical bound γₙ₋₁Σ|xᵢ| | 4.5·10⁻⁵ relative |
The bound is 7,932 times the disagreement. That factor is not constant either: the bound carries a factor of n and the disagreement does not, so at 256 terms it is about three orders and at 8,192 it is about four. A reader who used the bound as a proxy for the spread would be wrong by a factor that depends on the length of a vector they may not have chosen.
And the factor between the spread and κu is 0.253 to 0.258 across ten decades, a spread of 1.02. One of these two is a description of the disagreement and the other is an envelope containing it.
The number that does describe it
So the useful quantity is κu, times a constant near a quarter, and the reason is the mechanism where the disagreement comes from sets out: the error of a reduction is a walk whose steps are the spacings of its partial sums, the partial sums reach about Σ|xᵢ|/√n in magnitude on a vector with mixed signs, and the difference between two such walks is a random variable of that scale.
Three things make it worth reporting rather than the bound.
It is computable before anything runs. One pass over the data gives Σ|xᵢ|, and the answer’s own magnitude is what the computation is for. A library that returned κ beside a residual norm would cost one pass and would tell a caller how much of the number to believe.
It is an estimate rather than an envelope. The bound answers a question about the worst case that nobody is in. κu answers the question a caller has, which is how much two runs will differ.
It is honest about being an estimate. The constant in front moves between about 0.2 and 0.5 with the vector, and a short vector widens it further. That is a factor of two, against a factor of ten thousand for the alternative.
Why the bound cannot be repaired
A reasonable objection: derive a sharper bound, one that knows about the order. The literature has those — a bound for pairwise summation carries log₂n rather than n, and a bound for a p-way reduction carries n/p + log₂p. Do they answer the question?
They do not, and the reason is instructive. Those bounds are still worst cases over the roundings within a fixed ordering, so each is a single number covering everything that ordering might do. Distinguishing two orderings would need, for each, a bound and a matching lower bound tight enough that the two intervals do not overlap — and the intervals are [0, γ·Σ|xᵢ|], which all contain zero, so they overlap by construction.
Every summation error bound in the literature has zero as its lower end, because a sum can be exact by luck. That is exactly what makes a family of them unable to separate two members. The refusal in this essay’s refutation is that statement, mechanised: an assertion is handed the claim that the bound excludes one of two measured answers, and it must reject.
The factor of n is not merely pessimistic — it is absent
The bound’s looseness has a shape, and measuring it is more useful than noting it.
Hold the cancellation fixed at κ = 10⁸ and vary the length. The bound’s right-hand side carries γₙ₋₁ and therefore grows linearly with n: from 128 terms to 8,192 it rises by a factor of 64. The measured error does this:
| terms | mean relative error of a single-accumulator reduction |
|---|---|
| 128 | 4.18·10⁻⁹ |
| 512 | 3.15·10⁻⁹ |
| 2,048 | 2.18·10⁻⁹ |
| 8,192 | 3.12·10⁻⁹ |
Twenty-four vectors at each length, and a fitted exponent in n of −0.083. Not a smaller power of n. Not √n, which is what the modern probabilistic bounds replace n with. No power of n at all.
The explanation is the walk again and it is worth writing out, because two square roots cancel and that is not obvious.
A vector of n mixed-sign terms with Σ|xᵢ| fixed has entries of typical size Σ|xᵢ|/n, so its partial sums are a random walk that reaches about √n · Σ|xᵢ|/n = Σ|xᵢ|/√n. Each of the n roundings is therefore about u·Σ|xᵢ|/√n, and n of them accumulate as a walk rather than in a line, giving √n · u · Σ|xᵢ|/√n = u · Σ|xᵢ|. The first √n is the improvement a probabilistic bound already knows about — roundings do not conspire — and the second is one nobody writes down, because it comes from the data being a walk rather than from the arithmetic.
So the ratio between the bound and the disagreement grows linearly with the length: 2.8·10³ at 256 terms, 8.1·10³ at 2,048, 1.5·10⁵ at 8,192. A reader using the bound as an estimate is not out by a constant. They are out by a factor proportional to a length they may not have chosen.
The honest caveat: this is a statement about vectors whose partial sums wander like a walk, which is what mixed signs and no structure produce. A vector sorted by magnitude, or one with a systematic sign pattern, has partial sums that go somewhere rather than wandering, and there the n comes back — which is exactly the case the order they are added in measures when it sorts a million reciprocals and buys a factor of 470.
The asymmetry this leaves
The result is a strange epistemic position, and naming it is most of the value of this essay.
The size of the disagreement is predictable. 0.25κu, computable in one pass, stable across ten decades.
Which answer arrives is not predictable at all. It is the end point of a walk, and knowing the step sizes gives the scale of the end point and nothing about its value. The hero figure of the previous essay is not a curve with noise on it — it is noise, and the shape it has is the shape that particular vector and that particular scheduler produced.
Numerical analysis is generally in the opposite position. A condition number is a worst case, the achieved error is usually far below it, and the useful skill is knowing when the worst case is reached. Here the statistics are tight and the individual outcome is a coin flip, which is the situation the randomised field is in and no other: a bound that holds with probability is where this site first met a guarantee that changes kind, and the parallel is close enough to be worth stating and not close enough to be the same thing. There the randomness is drawn deliberately, from a seed the program owns. Here it is drawn by the scheduler, and nothing records what it drew.
What a lower bound would need
There is one honest way to bracket a computed answer, and it is the interval field’s: a limit is not a computation and the essays around it compute in directed rounding, so every operation returns an interval containing the true value. Applied to a reduction, that gives an interval containing the exact sum whatever the order — and therefore containing every ordering’s answer.
That is the correct object, and its width is the honest report. It costs a factor of about two in arithmetic and it needs rounding-mode control, which is exactly the machinery the direction the error leans measures. What it does not do is name which answer arrived: it says the truth is in here and so is every run, which is the same shape of statement as the bound and a much tighter version of it.
For a reader who needs the interval, that is the tool. For a reader who needs two machines to agree, the interval is not the answer either — the answer is to make the computation order-independent, which is the sum that cannot be wrong.
What a library could print, and why it does not
The gap between the bound and the disagreement is not an argument for a new theorem. It is an argument for a different return value, and the change is three lines.
A routine that computes a sum or an inner product already touches every term. Accumulating Σ|xᵢ| alongside costs one add and one absolute value per element — under a factor of two on a memory-bound loop, and nothing at all on one that is compute-bound. Dividing by the answer gives κ. Multiplying by u gives an estimate of how much two machines will disagree, good to a factor of two.
Compare that with what the neighbouring field had to build. An estimate that can be fooled is about the condition number of a matrix, which cannot be computed cheaply at all: the honest route is a singular value decomposition costing more than the solve it is describing, so every library ships an estimator instead, and the estimator can be fooled by a matrix built to fool it. κ of a sum has none of those problems. It is exact, it is one pass, and no matrix can be constructed to defeat it, because there is nothing to defeat — it is a ratio of two numbers the loop already has.
So the reason it is not printed is not cost and not difficulty. It is that the quantity has not been asked for, because the question it answers — will the next run agree — is not one the existing vocabulary can express. The whole of the previous essay is that observation and this essay is its consequence: the bound answers the question the vocabulary has, and the vocabulary is missing a question.
There is one more thing such a routine could return and it is free: the number of pieces the reduction was actually performed in. That single integer is what separates two runs, it is known to the runtime and to nobody else, and a result that carried it would let a caller reproduce a number rather than merely observe that they cannot.
The reading for the rest of the site
This essay is the reason the field is separate rather than a section of the arithmetic one, and the argument compresses to three lines.
The arithmetic field’s question is how large is the error, and the bound answers it.
This field’s question is how large is the disagreement between two correct runs, and the bound does not answer it, because it is the same number for both of them.
The quantity that does answer it — κ of the sum, times u, times a constant near a quarter — is not in any library’s output, is one pass over the data away, and is a property of the caller’s own data rather than of anybody’s code.
One further consequence, for anybody writing the documentation rather than the code. The sentence this routine is backward stable is true of every run in the hero figure and is heard by readers as a promise about repeatability, which it has never been. The two statements a caller needs are different and both are short: the answer is the exact sum of a vector a rounding away from this one, and two runs of it may differ by about κu. The first is the guarantee the literature gives. The second is the one that decides whether a test suite can be written, and it is missing from every manual page this site has read.
At other settings
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- An inner product with no fixed sign — both name reduction order, run-to-run variation, summation condition number
- The length that changes the kernel — both name error accumulation, reduction order, run-to-run variation
- The tolerance that buys no agreement — both name reduction order, run-to-run variation, unit roundoff
- A coin flip that fixes the average — both name error accumulation, unit roundoff
- A rank that depends on the thread count — both name reduction order, run-to-run variation
- A stopping test is a race — both name reduction order, run-to-run variation
Named objects
A flat tag is an object no other essay names yet.
A-priori boundError accumulationLower boundReduction orderRun-to-run variationSummation condition numberUnit roundoffWorst-case analysis