The answer that depends on the machine

A square that evaluates negative

(x − 1)⁶ evaluated near x = 1 comes out negative at 179 of 401 points on one build and 196 on another, and the two disagree about the sign at 98 of them. Neither is nearer the truth: both traces are made entirely of rounding.

Worth reading first: One multiply the compiler removed · Cancellation takes the answer, not a digit · What a float can hold.

The two essays before this one end on verdicts that two builds disagree about, and in both cases there is a right answer: the determinant is 1, the matrix is definite or it is not, and an exact computation settles it. This one has no right answer to reach for, and that is the point of it.

(x − 1)⁶ near x = 1, computed twice, negative in both and not in the same placesThe polynomial x⁶ − 6x⁵ + 15x⁴ − 20x³ + 15x² − 6x + 1 evaluated by Horner's rule at 401 points within 0.001 of x = 1, in units of 2.68·10⁻¹⁵ — the size of the rounding, since the true value here is under 10⁻¹⁸ and is a flat line on this axis. The upper trace rounds the multiply and the add separately; the lower one fuses them. A sixth power cannot be negative and the first is negative at 179 of the 401 points, the second at 196, and the two disagree about the sign at 98. Neither is more nearly right: both are the accumulated rounding of six cancelling terms, and they differ by at most 1.44·10⁻¹⁵ — one rounding of one product, six times. Any test on this value — a bisection, a definiteness check, a sign — gets a different answer from the two builds at a quarter of the points here.-101-101(x − 1) ÷ 0.001p(x) ÷ 2.68·10⁻¹⁵a square, drawn negativepoints sampled401negative, unfused179negative, fused196signs disagree at98widest gap1.4·10⁻¹⁵unfusedfusedthe true valuethe true curve is the flat oneeverything else is rounding
Fig. 1 x⁶ − 6x⁵ + 15x⁴ − 20x³ + 15x² − 6x + 1 evaluated by Horner’s rule at 401 points within 10⁻³ of x = 1, in units of the rounding. The dashed line is the true value, which is a sixth power and is flat on this axis.

Two traces of noise. The polynomial is (x − 1)⁶ expanded, so its value is a sixth power and cannot be negative; within 10⁻³ of the root it is under 10⁻¹⁸, which is below the rounding of the terms that produced it. One build returns a negative value at 179 of the 401 points and the other at 196, and the two disagree about the sign at 98 — a quarter of the window.

Why this is a different failure

In one multiply the compiler removed the fused form is exactly right and the other is exactly wrong, because the algorithm was designed around the instruction. In a matrix that is definite on one machine neither form is reliably right, but one of them is right on each matrix and an exact computation says which.

Here neither trace is nearer the truth in any useful sense. The true value is 10⁻¹⁸ and both evaluations return quantities around 10⁻¹⁵, so both are wrong by three orders of magnitude, and asking which is closer to zero is asking which random number is smaller. The largest difference between the two evaluations across the window is 1.44·10⁻¹⁵ — six roundings, exactly what the bound allows — and both are entirely made of them.

What the picture shows is therefore not an accuracy comparison. It is the shape of the region in which a computed sign belongs to the build, and that region has a width, which is computable.

Where the window’s edge is

The window is where |p(x)| falls below the rounding of the terms that make it up. Horner’s rule evaluating a degree-d polynomial commits about d roundings, each of size u times the largest partial value it holds, so the noise floor is roughly

u · max over the recurrence of |sₖ| ≈ u · Σ|cᵢ| |x|ⁱ,

which near x = 1 is u times the sum of the coefficients’ magnitudes: 1 + 6 + 15 + 20 + 15 + 6 + 1 = 64, giving about 1.4·10⁻¹⁴. The true value reaches that at |x − 1| = (1.4·10⁻¹⁴)^(1/6) ≈ 4.9·10⁻³.

Which is what the drag measures: at a window of 10⁻¹ the polynomial is 10⁻⁶ at the ends, both traces separate from zero and agree everywhere except in the middle; at 10⁻³ they are noise across the whole picture. The width is a property of the polynomial and the precision and is available before any evaluation is done.

That number — Σ|cᵢ| divided by |p(x)| — is exactly the summation condition number of the vector that hides it, applied to the terms of a polynomial. The essay’s census puts a residual at 10¹⁷ and this evaluation is the same object: an expression whose terms are enormous relative to their sum.

What a root finder does with it

The consequence is not that a value is wrong. It is that a branch is taken differently, and the branch is inside every algorithm that locates something by sign.

A bisection asks for the sign at the midpoint and discards half the interval. Inside the window that sign is a property of the build, so two builds discard different halves, converge to different points, and return roots that differ by the width of the window. Their residuals are the same size — both are 10⁻¹⁵, which is what convergence looks like here — and neither is wrong by the standards a root finder applies to itself.

This is the same mechanism the roots are not the coefficients measures for a root’s conditioning: a double root moves like √ε, a root of multiplicity m like ε^(1/m), so half the digits are lost at a double root and five sixths at a sixth-order one, with nothing ill conditioned anywhere. The window here is that fact seen from the other side. The conditioning says the root cannot be located better than 10⁻³ from data at the rounding level; the window says that inside that 10⁻³ the arithmetic’s own decisions are what a bisection is following.

The two agree, and they are different statements. The conditioning is a property of the problem and it is the same for both builds. The window is a property of the arithmetic, and inside it the two builds take different paths through a computation that both complete successfully.

Counting the disagreements is the measurement

The number worth quoting from the hero figure is not 179 or 196 — those are counts of a wrong sign, which is interesting once. It is 98, the number of points at which the two builds disagree with each other, because that is the quantity a person maintaining two machines actually meets.

It is worth seeing why it is neither 0 nor 401. It is not zero because the two evaluations differ by up to six roundings and the values are the size of one, so a disagreement is likely wherever the noise happens to straddle zero. It is not 401 because the two traces are strongly correlated: they share every input and differ only in how each of six multiply-adds was rounded, so most of the time they land on the same side of zero by accident of sharing most of their arithmetic.

A quarter is therefore the honest expectation, and it is stable across the window: at 10⁻⁴ and 10⁻⁵ the fraction is similar, and at 10⁻¹ it collapses to nearly nothing because the true value has come back above the noise. That stability is what makes the width of the window — rather than the count — the thing to compute in advance.

The general shape, since three essays have now produced it

This is the third instance of one pattern and it is worth writing down before the field moves on to reductions again.

A computation produces a real number. The number is a difference of quantities much larger than itself, so its leading digits are rounding. A consumer compares it with something — zero, a tolerance, another number — and turns it into a discrete outcome. Two conforming builds compute the rounding differently, so the outcome differs, and every diagnostic anybody applies afterwards reports that both builds behaved correctly.

The three instances differ only in what is being compared and whether there is an adjudicator:

what is computed compared with is there a right answer?
ad − bc zero yes — the exact determinant
a Cholesky pivot zero yes — the exact minors
a polynomial near a root zero no — the true value is below every drawing of it’s noise

The third row is the one that closes the sequence, because it is where the site’s usual move stops working. This collection’s habit is to answer a disagreement by computing the quantity exactly and saying who was right. Here the exact value is 10⁻¹⁸, it is not zero, and it is positive — so the “right” answer is that every negative value in the figure is wrong, which is true and useless, because no build was ever going to return it and no algorithm that consumes the sign can act on it.

What the exact value does establish is where the window is, which is the thing to compute.

Three things that do not fix it

Higher precision. It moves the edge: quadruple precision would put the noise floor at 10⁻³² and the window at |x − 1| ≈ 5·10⁻⁶. The window is narrower and it is still there, and inside it the same thing happens. This is the shape the whole field keeps producing — precision moves a boundary and does not remove one.

A tolerance. Declaring |p| < 10⁻¹⁴ to be zero converts a sign into three outcomes, positive, negative and cannot tell, which is genuinely better — but a bisection cannot use cannot tell without an answer for what to do next, and the honest answer is to stop and report an interval. Most implementations do not have that outcome and the ones that do return an interval of width 10⁻³, which is the conditioning again.

Turning off the contraction. It makes the trace reproducible between builds that share the flag, and it does not make it correct, and it makes it the less accurate of the two forms elsewhere. It is the option that most looks like a fix and buys the least.

What does work

Two things, and both are changes of formulation rather than of arithmetic.

Do not expand the polynomial. (x − 1)⁶ evaluated as a sixth power of (x − 1) is exact to a rounding at every point, has no cancellation anywhere, and is never negative. The whole failure is a consequence of writing a polynomial in a basis in which its value is a difference of large terms — which is what a monomial expansion does to any polynomial with a root away from zero, and what the roots are not the coefficients is about when it measures a Chebyshev basis against a monomial one.

Or evaluate with an error-free transformation. Compensated Horner — the same twoProduct and twoSum machinery the reproducible summation policies use — evaluates a polynomial as though in twice the precision, at about four times the cost, and pushes the noise floor to u² instead of u. That does not remove the window either; it narrows it to |x − 1| ≈ 4·10⁻⁶, which for most purposes is narrow enough that the conditioning is the binding constraint rather than the arithmetic.

Both are the same recommendation this site keeps arriving at from different directions: when a computed quantity is a difference of large terms, the repair is upstream of the arithmetic.

The window is not a defect of Horner’s rule

Worth heading off, because the obvious response to the figure is to blame the algorithm.

Horner’s rule is the best of the standard evaluations by every measure the subject applies. It uses d multiply-adds where the naive sum of powers uses about 2d operations, its backward error is optimal — the computed value is the exact value of a polynomial whose coefficients differ from the given ones by a relative γ₂d — and it is what every library uses. The failure here is not a failure of Horner’s rule; it is the failure the backward error statement predicts.

A polynomial whose coefficients are perturbed by 10⁻¹⁵ relative has roots that move by (10⁻¹⁵)^(1/6) ≈ 3·10⁻³ for a sixth-order root, and inside that neighbourhood the perturbed polynomial takes both signs. Horner returns the exact value of one such polynomial, and the fused build returns the exact value of a different one. Both are correct, both are answers to slightly different questions, and the questions differ by less than the data can distinguish.

That is the site’s founding identity applied to an evaluation rather than to a solve, and it puts this essay’s window exactly where three errors and one number would predict: the conditioning of the root is enormous, the backward error of the evaluation is at the rounding level, and their product is the width of the region in which nothing can be said.

Where else the sign of a nearly-zero quantity is read

Naming them, because a reader will recognise more of these than they expect.

A discriminant. b² − 4ac decides whether a quadratic’s roots are real, and near a double root it is the difference of two nearly equal products — exactly the determinant of one multiply the compiler removed with different letters.

A pivot. When symmetry is not enough chooses between a 1 × 1 and a 2 × 2 block by comparing computed quantities whose difference decides the branch.

A convergence test on a difference of iterates. |xₖ₊₁ − xₖ| is a difference of nearly equal things by construction, and its comparison with a tolerance is a tolerance that reads its own residual.

A determinant used to decide orientation, a curvature used to decide a step, a sign used to decide a reflection. Every one is a real number computed from cancelling terms and consumed as a bit.

The field’s general statement covers all of them: a stopping test is a race prices the third, and the pattern is that the arithmetic’s disagreement is small, the consumer is discrete, and the composition is a branch two machines take differently.

What to report instead of a sign

The recommendation the three FMA essays share, stated once here because this is where it is unavoidable.

A routine that computes a quantity and consumes its sign should return the quantity and a scale, not the sign. For the polynomial: return p(x) and Σ|cᵢ||x|ⁱ, from which a caller computes the noise floor and decides whether the sign means anything. For a Cholesky: return the pivot and the matrix norm. For a determinant: return the value and the sum of the magnitudes of its two products.

In every case the second number costs one accumulation the loop was nearly doing anyway, and it converts an unanswerable question — is this sign real — into an arithmetic one. That is the same move rank is a decision makes for a rank: the honest output is the spectrum with the threshold drawn on it, and the count above the threshold is the caller’s.

The reason it is not standard is that a sign has an obvious return type and a scale does not have an obvious name. sgn is one bit and (value, scale) is a struct, and a routine that returns a struct where the mathematics says sign looks like it is hedging. It is not hedging: the sign genuinely is not determined by the inputs at this precision, and returning one is a claim the arithmetic cannot support.

At other settings

(x − 1)⁶ near x = 1, computed twice, negative in both and not in the same placesThe polynomial x⁶ − 6x⁵ + 15x⁴ − 20x³ + 15x² − 6x + 1 evaluated by Horner's rule at 401 points within 0.1 of x = 1, in units of 10·10⁻⁷ — the size of the rounding, since the true value here is under 10⁻⁶ and is a flat line on this axis. The upper trace rounds the multiply and the add separately; the lower one fuses them. A sixth power cannot be negative and the first is negative at 7 of the 401 points, the second at 6, and the two disagree about the sign at 2. Neither is more nearly right: both are the accumulated rounding of six cancelling terms, and they differ by at most 1.54·10⁻¹⁵ — one rounding of one product, six times. Any test on this value — a bisection, a definiteness check, a sign — gets a different answer from the two builds at a quarter of the points here.-101-101(x − 1) ÷ 0.1p(x) ÷ 10·10⁻⁷a square, drawn negativepoints sampled401negative, unfused7negative, fused6signs disagree at2widest gap1.5·10⁻¹⁵unfusedfusedthe true valuethe true curve is the flat oneeverything else is rounding
Fig. 2 A wider window, where the true sixth power comes back above the noise and both builds agree everywhere except the middle.
(x − 1)⁶ near x = 1, computed twice, negative in both and not in the same placesThe polynomial x⁶ − 6x⁵ + 15x⁴ − 20x³ + 15x² − 6x + 1 evaluated by Horner's rule at 401 points within 10⁻⁵ of x = 1, in units of 2.66·10⁻¹⁵ — the size of the rounding, since the true value here is under 10⁻³⁰ and is a flat line on this axis. The upper trace rounds the multiply and the add separately; the lower one fuses them. A sixth power cannot be negative and the first is negative at 186 of the 401 points, the second at 205, and the two disagree about the sign at 97. Neither is more nearly right: both are the accumulated rounding of six cancelling terms, and they differ by at most 1.41·10⁻¹⁵ — one rounding of one product, six times. Any test on this value — a bisection, a definiteness check, a sign — gets a different answer from the two builds at a quarter of the points here.-101-101(x − 1) ÷ 10⁻⁵p(x) ÷ 2.66·10⁻¹⁵a square, drawn negativepoints sampled401negative, unfused186negative, fused205signs disagree at97widest gap1.4·10⁻¹⁵unfusedfusedthe true valuethe true curve is the flat oneeverything else is rounding
Fig. 3 And a narrower one, entirely inside the noise floor.
A determinant of one, computed as zero by the expression that is written downThe matrix [[x+2, x+1], [x+3, x+2]] at x = 2ᵏ has determinant exactly 1 at every k. The two products are x² + 4x + 4 and x² + 4x + 3, so they differ by one part in x², and above k = 26 they round to the same binary64 number. Relative error of two evaluations: ad − bc as written, which is exact until k = 27 and then returns zero at every larger size; and Kahan's form, w = bc, e = bc − w recovered by the fusion, (ad − w) − e, which is exact throughout. The difference between them is one rounding of one product — a relative 10⁻¹⁶ — and it is the whole of the answer, because the subtraction that follows removes everything else. Both forms are IEEE-754 conforming and a compiler may emit either from the same source.2022242628303210⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²k, where the entries are near 2ᵏrelative error of the determinantas writtenfused: exactproducts need 54 bitsone rounding, the whole answertrue determinant1naive, k = 300fused, k = 301first wrong at k27sizes returning 06both forms conformand the source does not say which
Fig. 4 The same instruction on the shortest expression it can decide.
Two conforming builds, one matrix, and 26 different verdicts in 200 triesForty 6 × 6 Gram matrices at each of five conditionings, each formed exactly from a tall matrix whose last column is nearly the sum of its first two. Every one of them is asked *are you positive definite* by a Cholesky, once with the inner products accumulated with a single rounding per term and once with each product rounded before it is subtracted. The bar is how many of the forty came back with different verdicts: 7 at 10⁻⁸, 2 at 10⁻⁹, 4 at 10⁻¹⁰, 10 at 10⁻¹¹, 3 at 10⁻¹². The two shaded parts split those by which build was right, settled by the signs of the leading principal minors computed in BigInt rationals — 9 to the fused form and 17 to the rounded one. So neither is the correct implementation. The verdict is a property of the build, and the answer to which build is right is a property of the matrix.-12-11-10-9-8024681012log₁₀ of how nearly dependent the columns areverdicts that disagreed, of 40724103which one is correctmatrices tested200verdicts disagreed26fused was right9unfused was right17lower part: thefused build was righta sign has no last digitso a verdict has nowhere to hide
Fig. 5 And on a verdict with an exact adjudicator, which this one does not have.
A double root, approached: the pair separates like √ε and the accuracy fails like √uA chain of 12 masses at β = β*(1 + ε), where β* is the critical damping and the smallest mode's two eigenvalues coincide at ε = 0. The separation of that pair is 0.6909√ε at every one of twelve decades — a spread of 1.013 in the constant — and the computed spectrum's worst relative error against the closed form rises as the pair closes, reaching 7.465·10⁻⁸ at the boundary itself. That is √u times a small constant: half the digits, on a problem where κ(K) is 67.83 at every stop and the coefficients are integers. Nothing here is ill conditioned in any sense this site has used before; what is unbounded is the derivative of the map from a coefficient to a double root.-15-13-11-9-7-5-3-110⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹log₁₀ ε, distance past the critical dampingseparation, and relative errorat ε = 0: 7.47·10⁻⁸separationcomputed errornothing is ill conditionedthe √ε constant0.69spread of it, twelve decades1error at the boundary7.5·10⁻⁸κ(K), unchanged throughout68half the digitsand no condition number to blame
Fig. 6 The conditioning of a multiple root, which is the other half of this picture.
Fitting the same degree-11 polynomial in two basesOn the left, the data and two fitted curves that lie on top of each other. On the right, the condition numbers of the two design matrices, ten orders of magnitude apart.00.10.20.30.40.50.60.70.80.910.20.40.60.81xyboth fits, drawn on top of one anothercondition number of the design matrixmonomial1.2·10⁸Chebyshev2.5largest fitted coefficientmonomial113Chebyshev0.51rms residual: 3.9·10⁻⁶ and 2.9·10⁻⁷ — the data is fitted either way.30 points, degree 11, single precisionthe basis is part of the problem
Fig. 7 The basis the polynomial is written in, which is where the repair lives.
Relative error of two algebraically identical expressions for (1 − cos x)/x², in binary32A log–log plot of relative error against x. The expression written as it reads loses accuracy as x falls and is eventually wrong in every digit; the rearranged form stays at rounding level.10⁻⁸10⁻⁶10⁻⁴10⁻²110⁻⁹10⁻⁶10⁻³1xrelative error of the computed value(1 − cos x)/x², as written2 sin²(x/2)/x²no digits left at allbinary32 throughoutone function, two spellings · zero below 3.5·10⁻⁴
Fig. 8 The mechanism, in one subtraction.
The summation condition number of six inner products this site already computesκ = Σ|xᵢ| ÷ |Σxᵢ| for six reductions taken from computations elsewhere on this site, at 64 terms: an orthogonality check between two columns of a Q, one component of a residual b − Ax on an ill-conditioned system, a nearly degenerate 2 × 2 determinant, a Hutchinson trace probe zᵀAz, a residual norm rᵀr, and a curvature pᵀAp. The range is 1 to 1.01·10¹⁷. The two at the safe end are sums of squares, where no term can cancel another; the three above 10¹⁰ are the orthogonality check, the residual and the determinant — which is to say every quantity a stopping test, an orthogonality test or an orientation test is written in. The reductions that are reproducible are the ones nobody makes a decision from.κ of the suma component of b − Ax1.01·10¹⁷ad − bc, near-degenerate3.6·10¹⁶qᵢᵀqⱼ, an orthogonality check7.39·10¹⁵pᵀAp, a curvature409zᵀAz, a trace probe41.8rᵀr, a residual norm1measured, not assumedhighest10¹⁷lowest1above 10¹⁰3terms64sums of squares are safeand nobody decides anything from one
Fig. 9 Where an expression like this one sits among the site’s reductions.
The same 4096 numbers, added up 26 ways, 21 different answersEach dot is one reduction of one vector of 4096 binary64 numbers whose summation condition number is 1.01·10⁸: the vector is cut into p contiguous pieces, each piece summed left to right, and the pieces combined in a tree. The vertical position is the distance from the exactly rounded sum, relative. Filled dots are the static split a fixed thread count gives; open dots are unequal splits, which is what a work-stealing scheduler produces at the same p. 21 of the 26 runs returned distinct values, spanning 1.55·10⁻¹³ — 2.3·10⁷ ulps of the answer. The dashed line is the classical bound γ₍ₙ₋₁₎Σ|xᵢ|, which every one of them satisfies with 2.58·10⁴ to spare, and which is the same number for all of them: it contains n and Σ|xᵢ| and nothing about the order.110¹10⁻¹¹10⁻⁸10⁻⁵pieces the vector was divided intodistance from the exact sum, relativethe published boundκ · uone vector, one algorithmdistinct answers21runs26spread, in ulps2.3·10⁷κ of the sum10⁸bound ÷ worst error2.6·10⁴nobody chose pand no answer is the answer
Fig. 10 The field’s other cause, which needs more than one worker.
What the runs disagree by, and what the bound says they mightOver ten decades of summation condition number, on vectors of 2048 numbers: the measured spread between seven partitioned reductions of the same vector, the quantity κu, and the classical error bound γ₍ₙ₋₁₎Σ|xᵢ| relative to the sum. The measured spread and κu are one curve times a constant — the ratio runs from 0.253 to 0.258 across the whole sweep, a spread of 1.021 while both quantities move by ten orders. The bound sits 7932 to 8100 above the disagreement and is identical for every ordering, which is what makes it useless for the question a reader actually has: not how wrong is this, but will the next run say the same.10²10⁴10⁶10⁸10¹⁰10¹²10⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹κ of the sumrelative sizethe boundκ · umeasured spreadtwo curves and one constantspread ÷ κu, low0.25spread ÷ κu, high0.26bound ÷ spread, low7932decades swept10the spread is computablethe bound cannot see the order
Fig. 11 And its size, measured against a bound with the same blindness.
Error of a difference quotient for J(x)v against ε, on the Bratu problem at n = 64The Jacobian of this problem is a formula, so the error of each quotient is measured against a derivative that is exact rather than against a better quotient. The forward difference falls with a slope of 1.01 — first order — reaches 1.28·10⁻¹⁰ at ε = 10^-6, and rises again with a slope of -1.00 as cancellation takes over. The central difference falls with a slope of 2.00 and bottoms at 1.11·10⁻¹² for two residual evaluations instead of one. Neither gets near the unit roundoff at any ε.10⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³10⁻¹10⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1εrelative error in J(x)vforwardcentralcancellationtruncationagainst a derivative that is exactforward floor1.3·10⁻¹⁰central floor1.1·10⁻¹²truncation slope, forward1truncation slope, central2no ε reaches the roundoffand the analytic derivative is free of the choice
Fig. 12 A floor under a computed difference, which is what the window is.
What the solver reported, and what it achievedFinal relative residual and final relative error against the working precision, on a logarithmic vertical axis. The residual sits at the stopping tolerance at every precision — the method converged, by every test available to it. The error runs from 1.4·10⁻¹³ at 53 bits to 0.00597 at 8, tracking the unit roundoff, which is drawn beside it.614223038465410⁻¹³10⁻¹⁰10⁻⁷10⁻⁴working significand bitsrelative sizeerrorresidualuthe gap the solver cannot seeerror ÷ residual at 24 bits1.5·10⁶error ÷ residual at 16 bits2.3·10⁷error ÷ residual at 8 bits2.4·10¹⁰every convergence test passesand the answer is wrong in proportion to u
Fig. 13 A residual that cannot see what it is asked about.
Past the cliff: what each method returnsLoss of orthogonality at four condition numbers past κ²u = 1. Cholesky QR returns a factor whose implied Q is 0.37 away from orthogonal at κ = 10⁸ and 1.49 at 10¹² — and at 3·10¹⁰ it refuses outright, on a pivot of -6.5·10⁻¹⁷. The sweep and the tree return a usable factorisation of every one of these matrices.‖QᵀQ − I‖ of the implied Qκ = 10⁸, Cholesky0.37κ = 10⁸, sweep8.5·10⁻⁹κ = 10¹⁰, Cholesky1.3κ = 10¹⁰, sweep3·10⁻⁷κ = 3·10¹⁰, Choleskyrefusedκ = 3·10¹⁰, sweep6.7·10⁻⁶κ = 10¹², Cholesky1.5κ = 10¹², sweep1.4·10⁻⁴the safe run is the one that failsrefusals in the range1wholly non-orthogonal returns2the pivot it refused on-6.5·10⁻¹⁷one of these outcomes is safeand it is the refusal
Fig. 14 The third outcome a sign test could have and usually does not.
The width of a guaranteed bracket, and the error it guarantees, at 24 bitsTwo rising curves on logarithmic axes. The upper one, the bracket width, rises faster than the lower one, the actual error.10¹10²10³10⁴10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸10⁻⁷10⁻⁶10⁻⁵10⁻⁴10⁻³terms summedrelative widthbracket widthactual errora bound with no tolerance in itbracket contains the truth7width at 10,000 terms4.4·10⁻⁴error it bounds2.4·10⁻⁶every sum computed twice, up and downtrue at every size, useful at none of the large ones
Fig. 15 The instrument that produces that third outcome honestly.
The exact solution of a 13×13 Hilbert system beside the computed oneTwo columns of numbers: the exact answer, which is the integers one to thirteen, and the answer double-precision elimination returns, with the number of correct digits beside each.H13 x = b, b formed exactly so that x = (1, 2, …, 13)12345678910111213exact1.00002.00003.00133.97865.18864.993010.46720.048921.2657-2.575319.21478.906013.5113computed6.6 correct digits4.8 correct digits3.4 correct digits2.3 correct digits1.4 correct digit0.8 correct digitno correct digitsno correct digitsno correct digitsno correct digitsno correct digits0.6 correct digit1.4 correct digitbackward error2.2·10⁻¹⁷κ = 1.7·10¹⁸The algorithm solved a neighbouring problem perfectly. That problem's answer is this one.right-hand side built in BigInt rationalsthe truth is known
Fig. 16 And the one that removes the question, at a cost.
One system, one tolerance, and 11 different amounts of workConjugate gradients on a 200 × 200 symmetric positive definite matrix with κ = 10⁴, stopped when the relative residual falls below 10⁻¹⁰, run at each of 13 partition counts. The only thing that differs between the runs is how many pieces the two global inner products were summed in — which on a real machine is the number of workers. Iteration counts run from 674 to 690, 11 of them distinct, a spread of 2.4% of the work. Every run converged and every answer is right to the accuracy asked for; the forward errors span 6.31·10⁻¹¹ to 1.08·10⁻¹⁰, a factor of 1.72. What differs is not a digit at the end of an answer — it is the bill, and it is an integer.110¹670673676679682685688691694pieces the inner products were summed initerations to the tolerance674, the cheapest run690, the dearestthe same solve, pricedpartitionings run13distinct counts11spread, per cent2.4best forward error6.3·10⁻¹¹worst1.1·10⁻¹⁰one matrix, one toleranceand the cost is the machine's
Fig. 17 A branch taken differently, counted in iterations.
The numerical rank of one matrix is 10, 12, or somewhere betweenSingular values of one 60 × 14 matrix whose spectrum falls by a fixed factor per index, so there is no gap anywhere and the threshold decides the rank. Each curve is the same matrix, its Gram matrix formed with the inner products summed in a different number of pieces. The curves lie on top of each other for the first several values and separate below about 7.3·10⁻¹³, which is where forming AᵀA has put the rounding. The dashed line is the threshold, σ₁ · 10⁻¹⁴. Counting the values above it gives 12 at p = 1, 12 at p = 2, 12 at p = 4, 10 at p = 8, 10 at p = 16, 11 at p = 32, 11 at p = 60 — the rank of one matrix, as a function of how many workers were available. Not a digit of an answer: the number of columns a model built from this matrix would have.13579111310⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹index ksingular valueσ₁ · 10⁻¹⁴, the thresholdone matrix, three rankspartitionings7lowest rank10highest rank12threshold7.3·10⁻¹⁴σ₁7.3the curves separate in the noiseand the threshold is drawn through it
Fig. 18 And counted in columns.
The smallest defect a regression test can catch, on a machine that will not repeat itselfA 150 × 150 system with κ = 10⁴, solved by conjugate gradients to 10⁻¹⁰ on six partitionings. The shaded band is how far the answer moves across those six when nothing at all is wrong: 3.24·10⁻¹², relative. Each pair of dots is one defect — a single entry of the matrix changed by a relative δ, an assembly slip or a stale coefficient — solved on the same six machines, showing its nearest and furthest run. A defect is catchable only when its nearest run clears the band, because a test whose threshold sits inside the band fails a correct build. Everything at or below 10⁻¹³ overlaps and is invisible; 10⁻¹² is the smallest that separates, at 4.61·10⁻¹². So the tolerance exists, it is bracketed between 3.24·10⁻¹² and 4.61·10⁻¹² — a factor of 1.42 — and it is neither zero nor the 10⁻⁸ that usually gets typed.-15-13-11-910⁻¹³10⁻¹¹10⁻⁹10⁻⁷log₁₀ of the defect, relative to the entry it sits inhow far the answer movedthe machine, on its owna tolerance with two sidesmachine band3.2·10⁻¹²smallest caught10⁻¹²its nearest run4.6·10⁻¹²defects hidden3window, factor1.4below the band nothing is visibleand above it everything is
Fig. 19 What a test can ask for when the branch is not stable.
Forward error of a 6×6 Hilbert solve at eight precisionsA bar for each significand width from 12 to 53 bits showing the relative error in the computed solution, with the condition number times the unit roundoff marked as a prediction.κ = 1.5·10⁷ · the exact answer is (1, 2, …, 6)12 bits3.316 bits0.8620 bits4.324 bits0.09330 bits7.6·10⁻⁴36 bits6.2·10⁻⁶43 bits2·10⁻⁷53 bits4.5·10⁻¹¹dashed: κ · unit roundoffone matrix, eight arithmeticsmeasured against a known answer
Fig. 20 The knob that narrows the window and does not close it.
Relative error of three summation algorithms in binary32A log–log plot of relative error against the number of terms for naive, pairwise and compensated summation, each measured against the exactly rounded sum.10¹10²10³10⁴10⁵10⁶10⁻⁹10⁻⁷10⁻⁵10⁻³10⁻¹number of terms addedrelative error against the exact sumin orderin a treecompensatedbinary32 · terms are 1/icompensated: 3·10⁻⁸
Fig. 21 The same roundings, accumulated rather than exposed.
Iterative refinement from a 24-bit factorisation, κ = 10⁴A semi-logarithmic plot of forward error against refinement step. One curve falls steeply to the level of a double-precision solve; the other is nearly flat.012345610⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹refinement step‖x − x*‖ / ‖x*‖a full double-precision solveresidual in24-bitresidual indoubleone argument apartκ·u of the factorisation6·10⁻⁴double residual, final3.2·10⁻¹³same-precision, final1.3·10⁻⁴30×30, κ = 10⁴, same factors in both runsidentical cost
Fig. 22 Buying accuracy back after the fact, which buys none of this field’s property.
How close Hager's estimate is to the true κ₁, over 200 seeded 8×8 matricesFive bars. The estimate is exactly the true condition number on 81% of the sample and inside ten per cent on 87%; the worst underestimate in the whole sample returns 38% of the truth. The last bar is the matrix built to defeat it, at 7.7%, well below anything the random sample reached.each bar is a percentage — of the sample, or of the true condition numberexactly right80.5%inside 10%87.0%inside a factor of 287.0%worst in the sample, ×10037.7%the constructed matrix, ×1007.7%usually exactexact share0.81worst of the sample0.38the constructed matrix0.077a routine that is right most of the timeand never wrong in the safe direction
Fig. 23 An estimator’s spread, which is a different uncertainty about one number.
The residual conjugate gradients reports and the residual of the vector it holds, along one runA 50×50 diagonal matrix with one eigenvalue at 10⁻¹⁰ and the rest between 1 and 50, so every product with it is exact to a rounding and nothing below can be blamed on the operator. The lower curve is r ← r − αAp, updated by the recurrence, which is what a stopping test reads. The upper curve is ‖b − Ax‖/‖b‖, recomputed from the iterate. They start as the same vector and end 8.6·10⁸ apart, with the reported one at 6.89·10⁻²¹ — below the unit roundoff of 1.11·10⁻¹⁶, which is the shortest proof available that it is not the residual of anything.0122436486072849610⁻²²10⁻¹⁸10⁻¹⁴10⁻¹⁰10⁻⁶10⁻²conjugate gradient iterationrelative residualthe unit roundoff, 1.11·10⁻¹⁶the answer's residualthe residual reportedtwo residuals, one runreported, at its best6.9·10⁻²¹the answer's, at its best5.9·10⁻¹²unit roundoff1.1·10⁻¹⁶largest iterate on the way9.3·10⁹iterations drawn96the recurrence remembers every roundingand the stopping test is written in it
Fig. 24 Two residuals for one iteration, of which a stopping test sees one.
Numbers stored per unknown, against the size of the matrix, at 10⁻⁸The dense matrix stores n numbers per unknown, which is the straight line through the origin and doubles whenever n does. The hierarchical representations store 54, 79, 106, 133 and 50, 70, 94, 120, adding about 26 per doubling — a constant per doubling is a logarithm, and it is the whole claim. At n = 512 that is 26 and 23 per cent of the dense matrix, and the share falls at every size. The exponent between consecutive sizes is 1.55, 1.42, 1.33, falling towards one and never arriving, which is what a logarithm looks like from inside.56789100108216324432log₂ nnumbers stored per unknowndenseweak: every off-diagonal blockstrong: only the admissible onesa constant per doublingstrong, n = 5126.8·10⁴weak, n = 5126.1·10⁴dense, n = 5122.6·10⁵per doubling26‖A − A_H‖ ⁄ ‖A‖3.8·10⁻¹⁰the dense line doublesand the other two add a constant
Fig. 25 A storage cost that follows from a decision about a threshold.
Conjugate gradients at κ = 104, against the bound κ permitsA semi-logarithmic plot of the relative A-norm error against iteration count. The measured curve falls below a smooth dashed curve showing the classical condition-number bound.0408012016020024010⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹iteration‖e‖_A / ‖e₀‖_Ameasuredκ bound119 steps40×40, spectrum spread evenly in logbound permits 1417
Fig. 26 The convergence whose crossing point a tolerance sets.
The residual basis of conjugate gradients, at κ = 106A semi-logarithmic plot against iteration count showing the loss of orthogonality among the residual vectors rising while the relative residual falls.05101520253010⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹iteration‖RᵀR − I‖ and ‖r‖/‖b‖step n‖RᵀR − I‖residual30×30, run for exactly n stepsexact arithmetic would end here
Fig. 27 The loss of orthogonality that amplifies a small perturbation over hundreds of steps.

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.

Named objects

A flat tag is an object no other essay names yet.

BisectionBitwise reproducibilityCatastrophic cancellationError accumulationExpression contractionFused multiply-addMultiplicityNoise floor