Two errors, and whose fault they are

The second factor was the last row

Wilkinson's polynomial in Chebyshev coefficients loses its roots exponentially from the colleague matrix, and two factors accounted for the loss: the roots' own conditioning, and the size of the matrix's last row against the rest of it. A diagonal similarity by powers of two — balancing, which changes no eigenvalue and rounds nothing — removes the second factor entirely: the balanced error sits within a factor of two and a half of the conditioning at every degree from fourteen to forty, three and a half thousand times better than unbalanced at forty. What is left is the conditioning, still exponential. Balancing the monomial companion matrix takes its norm down by forty-five orders and gains nothing, because there the error was never the matrix's.

Worth reading first: The condition number is an amplifier · Two approximants and one matrix size · A matrix that depends on its own eigenvalue.

A basis that has to know where the roots are took Wilkinson’s polynomial, ∏i=1n(x−i)\prod_{i=1}^n (x - i), expanded it exactly in the Chebyshev basis on [1,n][1, n], rounded the coefficients once to doubles and computed the roots as the eigenvalues of the colleague matrix. It was a test of a claim the roots are not the coefficients had made without measuring: that the Chebyshev basis rescues the roots the monomial basis loses. It did rescue them, by nine orders of magnitude at degree twenty. It did not stop the loss. The error still grew exponentially with the degree — 1.3⋅10−151.3 \cdot 10^{-15} at six, 2.8⋅10−42.8 \cdot 10^{-4} at forty — where a polynomial with its roots at Chebyshev points stayed at rounding to degree forty.

The essay accounted for the loss with two factors whose product sat within a factor of twenty of the measured error from degree fourteen on. One was the roots’ normwise conditioning: how far a relative change of size uu in the coefficient vector moves each root. The other was ∥c∥/∣cn∣\|c\|/|c_n|, the size of the coefficient vector against its leading coefficient, which is the size of the colleague matrix’s last row against the rest of it. That second factor is not a property of the roots at all. It is a property of how the problem was handed to the eigenvalue routine, and the essay predicted, with a sign, what removing it would do.

“Diagonal balancing of the companion matrix is a standard step before its eigenvalues are computed. The prediction with a sign is that balancing the colleague matrix removes most of the second factor on the integers — bringing the error to within a factor of ten of the normwise conditioning alone at every degree from fourteen to forty — which would leave the conditioning as the only exponential.”

Both halves hold. The rest of this essay is about why they hold, and about the matrix on which the same step does nothing.

A similarity that rounds nothing

The colleague matrix of a degree-nn Chebyshev series is the Chebyshev recurrence written as a matrix — halves on the sub- and superdiagonals, a one in the first row — with the coefficients −cj/(2cn)-c_j/(2c_n) added to its last row. Its eigenvalues are the roots. When the coefficients are much larger than the leading one, that last row is much larger than the rest of the matrix; on Wilkinson’s polynomial the ratio ∥c∥/∣cn∣\|c\|/|c_n| is 2.2 at degree ten, 46 at twenty and 4.4⋅1044.4 \cdot 10^4 at forty.

Balancing, in the form Parlett and Reinsch gave it and every eigenvalue library applies by default, replaces a matrix CC by D−1CDD^{-1}CD with DD diagonal, choosing each entry of DD to make the off-diagonal mass of its row equal to that of its column. Two details make it free. A similarity changes no eigenvalue. And every entry of DD is chosen to be a power of two, so that multiplying a row by it and dividing a column by it changes exponents only: no entry of the balanced matrix carries a rounding error the original did not. Whatever balancing does to the computed roots, it does by changing what the eigenvalue routine’s own rounding is relative to.

That is the whole mechanism. A backward-stable eigenvalue routine — Francis’s iteration here, the algorithm the libraries actually run — returns the exact eigenvalues of a matrix within about u∥C∥u\|C\| of the one it was given. If ∥C∥\|C\| is dominated by one row, the perturbation it is allowed is that row’s size spread over every entry, including the halves of the recurrence, and the recurrence entries are the ones the roots are sensitive to.

The second factor goes

Wilkinson's polynomial in the Chebyshev basis: the worst relative root error from the colleague matrix, unbalanced and balanced, against degree, beside the roots' conditioning times the unit roundoff and the same times the colleague matrix's coefficient ratiodegree 6: unbalanced 1.3·10⁻¹⁵, balanced 1.3·10⁻¹⁵, conditioning 6.6·10⁻¹⁷, ratio 1; degree 10: unbalanced 1.8·10⁻¹⁴, balanced 3.6·10⁻¹⁵, conditioning 4.2·10⁻¹⁶, ratio 2.2; degree 14: unbalanced 1.2·10⁻¹⁴, balanced 8.9·10⁻¹⁵, conditioning 3.7·10⁻¹⁵, ratio 6.9; degree 18: unbalanced 2.4·10⁻¹³, balanced 2.5·10⁻¹⁴, conditioning 3.8·10⁻¹⁴, ratio 24; degree 20: unbalanced 4.4·10⁻¹³, balanced 9.1·10⁻¹⁴, conditioning 1.3·10⁻¹³, ratio 46; degree 24: unbalanced 5.8·10⁻¹¹, balanced 1.2·10⁻¹², conditioning 1.5·10⁻¹², ratio 172; degree 28: unbalanced 1.6·10⁻⁹, balanced 9.8·10⁻¹², conditioning 1.8·10⁻¹¹, ratio 668; degree 32: unbalanced 6.8·10⁻⁸, balanced 2.2·10⁻¹⁰, conditioning 2.3·10⁻¹⁰, ratio 2659; degree 40: unbalanced 2.8·10⁻⁴, balanced 7.9·10⁻⁸, conditioning 4·10⁻⁸, ratio 4.4·10⁴. At degree 40 balancing gains a factor of 3467.1015202530354010⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³degree n, roots at 1 … nworst relative root errortwo factorsunbalancedbalancedconditioning alonedashed: the two predicted linesbalancing removes the second factor
Fig. 1 The worst relative root error of Wilkinson’s polynomial in the Chebyshev basis against degree: from the colleague matrix unbalanced and balanced, beside the roots’ conditioning times u and the same times the coefficient ratio — the two factors. Unbalanced, the error follows the two-factor line; balanced, it follows the conditioning alone.

Balanced, the worst root error is within a factor of 2.4 of the conditioning at every degree from fourteen to forty: 2.4 times it at fourteen, 0.66 at eighteen, 0.70 at twenty, 0.80 at twenty-four, 0.54 at twenty-eight, 0.96 at thirty-two and 2.0 at forty. The prediction allowed a factor of ten and needed none of it. Unbalanced, the same roots are more than ten times the conditioning from degree twenty-four on, and at forty 7,000 times it.

The gain is the coefficient ratio, almost exactly. At degree forty the unbalanced error is 2.8⋅10−42.8 \cdot 10^{-4} and the balanced one 7.9⋅10−87.9 \cdot 10^{-8}: three and a half thousand times smaller, against a ratio of 4.4⋅1044.4 \cdot 10^4 and a two-factor line that over-predicted the unbalanced error by about six. At degree twenty the gain is 4.8 against a ratio of 46. Below degree fourteen there is nothing to gain: the ratio is two or less, and the balanced and unbalanced errors are the same to the first figure.

The two ends of the range are where the balanced route sits furthest from the conditioning, and for opposite reasons. At degree fourteen the error is 8.9⋅10−158.9 \cdot 10^{-15}, a few dozen units of roundoff, and the conditioning is smaller still: the route has reached the floor any eigenvalue computation of that size reaches, and the ratio of 2.4 measures the floor rather than the problem. At degree forty the ratio is 2.0 for the opposite reason. The worst root is no longer a small perturbation of a simple eigenvalue — it is more than a hundred billion times as sensitive as the best one — and a first-order condition number begins to under-predict what a finite perturbation does. In between, from eighteen to thirty-two, the balanced error sits slightly below the normwise line, which is what a bound that charges every coefficient its worst-case share should do on a perturbation that does not.

Where in the matrix the norm was

The colleague matrix's Frobenius norm before and after balancing, the largest over the smallest entry of the balancing diagonal, and the coefficient ratio, against degreedegree 6: ratio 1, norm 1.8 to 1.8, diagonal spread 1; degree 10: ratio 2.2, norm 2.7 to 2.5, diagonal spread 2; degree 14: ratio 6.9, norm 6.2 to 3.5, diagonal spread 16; degree 18: ratio 24, norm 21 to 4.1, diagonal spread 16; degree 20: ratio 46, norm 39 to 4.4, diagonal spread 64; degree 24: ratio 172, norm 153 to 5.9, diagonal spread 256; degree 28: ratio 668, norm 609 to 6.1, diagonal spread 1024; degree 32: ratio 2659, norm 2492 to 6.8, diagonal spread 1024; degree 40: ratio 4.4·10⁴, norm 4.4·10⁴ to 10.6, diagonal spread 6.6·10⁴. The diagonal entries are powers of two, so balancing changes no eigenvalue and rounds nothing.10152025303540110¹10²10³10⁴10⁵degree nsizediagonal's spreadcoefficient rationorm, unbalancednorm, balancedthe last row was the normthe norm falls to the size of the recurrence
Fig. 2 The colleague matrix’s Frobenius norm before and after balancing, the balancing diagonal’s largest entry over its smallest, and the coefficient ratio, against degree. Unbalanced, the norm is the ratio; balanced, it is under twelve at every degree; the diagonal spans about the ratio.

The norm tells the same story from the other end. Unbalanced, the colleague matrix’s Frobenius norm tracks the coefficient ratio — 39 at degree twenty against a ratio of 46, 4.4⋅1044.4 \cdot 10^4 at forty against 4.4⋅1044.4 \cdot 10^4 — because the last row is nearly all of it. Balanced, the norm is 4.4 at degree twenty and 11 at forty: the size of the recurrence’s own halves and ones, with the last row brought down to meet them. The balancing diagonal does it with entries spanning a factor of 64 at degree twenty and 6.6⋅1046.6 \cdot 10^4 at forty — the ratio again, now expressed as how far apart the scales of the matrix’s first and last coordinates had to be moved.

In the language of the earlier essay’s factors, the second factor was never a property of the polynomial’s roots or of its Chebyshev coefficients as a description of them. The earlier essay showed that rounding the coefficients alone moved the roots by less than a thirtieth of the measured error from degree eighteen on; the coefficients were a faithful description. The factor belonged to the eigenvalue problem built out of them, and a diagonal change of coordinates that is exact in floating point takes it away.

Why the halves are the part that matters

It is worth saying which perturbation the unbalanced matrix lets through, because the argument is about structure rather than size. The colleague matrix has two kinds of entry. The recurrence’s halves and the one in the first row are the same for every polynomial of degree nn; they encode the Chebyshev basis itself. The last row encodes this particular polynomial. A perturbation confined to the last row is a perturbation of the coefficients, and the roots respond to it with exactly the conditioning the essay’s first factor measures. A perturbation of the recurrence entries is a perturbation of the basis — the matrix then describes a polynomial in a slightly different family — and nothing in the coefficients’ conditioning bounds what that does to the roots.

A backward-stable routine is free to spend its error anywhere in the matrix, in proportion to the matrix’s norm. When the last row dominates the norm, an error of u∥C∥u\|C\| placed on a recurrence half is an error of u∥c∥/∣cn∣u\|c\|/|c_n| relative to that half — the coefficient ratio, applied to entries whose exactness the roots depend on. Balancing reshapes the matrix so that every row and column carries comparable mass; the routine’s error budget, still uu times the norm, is then a small relative change of every entry, the recurrence included. That is why the gain is the ratio and not some other function of it: the ratio is precisely the excess relative error the recurrence entries were being charged.

The condition number is an amplifier put the general version: a condition number is the largest ratio of output change to input change, and which input it is measured over is part of its definition. Measured over the coefficients, these roots’ conditioning is the first factor. Measured over every entry of the unbalanced matrix in proportion to its norm, it is the product of both. An accuracy that is a backward error makes the corresponding point about the other side of the product: a backward error means only what the norm it is stated in means.

What balancing costs

Balancing is cheap enough that libraries apply it unasked. Each sweep visits every row and column once, O(n2)O(n^2) work against the eigenvalue iteration’s O(n3)O(n^3), and the colleague matrices here converge in one sweep at degree six, four at twenty and seven at forty. The diagonal it produces is the record of how lopsided the matrix was: on the colleague matrices it spans the coefficient ratio; on the monomial companion matrices it spans 1.8⋅10191.8 \cdot 10^{19} at degree twenty and 1.2⋅10491.2 \cdot 10^{49} at forty, the range of the monomial coefficients themselves. On the Chebyshev-point polynomials, whose coefficients are all alike, a single sweep finds nothing to move and the diagonal is exactly the identity.

That last fact is what makes the step safe to automate. A balancing that could make a well-scaled matrix worse would have to be applied with judgement; one that leaves a balanced matrix bit-for-bit unchanged can be applied always, and pays off on the matrices whose scaling was set by an accident of representation. Wilkinson’s polynomial in the Chebyshev basis is such a matrix. The same polynomial in the monomial basis is not, because there the representation’s accident is in the coefficients themselves, before any matrix is formed.

Root by root

Each root's relative error from the colleague matrix at degree 32, unbalanced and balanced, beside each root's conditioning times the unit roundoffUnbalanced: worst 6.8·10⁻⁸. Balanced: worst 2.2·10⁻¹⁰. Conditioning: worst 2.3·10⁻¹⁰. The balanced errors follow the conditioning root by root, worst in the middle of the interval; the unbalanced ones sit a factor of about 310 above them.degree 32unbalanced, worst6.8·10⁻⁸balanced, worst2.2·10⁻¹⁰conditioning × u, worst2.3·10⁻¹⁰5101520253010⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³rootrelative erroryellow: unbalanced · blue: balanced · dashed: conditioningthe balanced error is the conditioning
Fig. 3 Each root’s relative error at the degree on the dial, from the colleague matrix unbalanced and balanced, beside each root’s own conditioning times u. Balanced, the errors follow the conditioning root by root, worst in the middle of the interval; unbalanced, they sit a constant factor above.

The worst-case picture hides nothing. At degree thirty-two the balanced errors follow each root’s own conditioning across the whole interval: about 10−1510^{-15} at the ends, where the roots are well conditioned, rising to 2⋅10−102 \cdot 10^{-10} at the sixteenth root, where the polynomial’s humps between neighbouring roots are smallest and its slope at a root least, and falling again. The unbalanced errors have the same shape a factor of about three hundred higher. Turn the dial from twenty to forty and the gap between the two curves widens with the coefficient ratio while the balanced curve stays on the conditioning.

That is the strongest form of the prediction’s second half. With the matrix balanced, the only thing that grows exponentially is the conditioning, and it does: from 1.3⋅10−131.3 \cdot 10^{-13} at degree twenty to 4.0⋅10−84.0 \cdot 10^{-8} at forty, five and a half decades in twenty degrees. Balancing returns the routine’s accuracy to what the problem allows. It cannot return more, and the problem allows less with every degree, for the reason the earlier essay drew: equispaced roots make a polynomial whose middle is tiny next to its ends, and a root where the polynomial is tiny is a root its coefficients barely determine.

The matrix with nothing to remove

Wilkinson's polynomial in the monomial basis: the worst relative root error from the companion matrix, balanced and not, against degree, beside the roots' conditioning times the unit roundoff, drawn up to tendegree 6: unbalanced 1.7·10⁻¹³, balanced 3.4·10⁻¹³, conditioning 3.5·10⁻¹³, norm 2615 to 31; degree 10: unbalanced 1.1·10⁻¹⁰, balanced 1.6·10⁻¹⁰, conditioning 2.6·10⁻¹⁰, norm 1.9·10⁷ to 93; degree 14: unbalanced 7.2·10⁻⁷, balanced 3.1·10⁻⁷, conditioning 2.2·10⁻⁷, norm 6.1·10¹¹ to 184; degree 18: unbalanced 7.2·10⁻⁴, balanced 2.8·10⁻⁴, conditioning 2·10⁻⁴, norm 5.5·10¹⁶ to 333; degree 20: unbalanced 0.0076, balanced 0.017, conditioning 0.006, norm 2.3·10¹⁹ to 380; degree 24: unbalanced 0.056, balanced 0.12, conditioning 5.8, norm 6.8·10²⁴ to 525; degree 28: unbalanced 0.1, balanced 0.26, conditioning 5775, norm 3.8·10³⁰ to 757; degree 32: unbalanced 0.23, balanced 0.34, conditioning 5.8·10⁶, norm 3.7·10³⁶ to 993; degree 40: unbalanced 1, balanced 0.56, conditioning 6.2·10¹², norm 1.4·10⁴⁹ to 1530. Balancing takes the norm down by up to forty-five orders and leaves the error where the conditioning puts it.1015202530354010⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1degree nworst relative root errorbalancedunbalancedconditioning × uan error of one: the root not found at allnothing to remove but the conditioning
Fig. 4 Wilkinson’s polynomial in the monomial basis: the worst root error from the companion matrix, balanced and not, beside the roots’ conditioning times u, drawn up to ten. Balancing takes the norm from 2.3·10¹⁹ to 380 at degree twenty and the error stays where the conditioning puts it.

The monomial companion matrix is the textbook case for balancing, and its coefficients are far worse scaled than the colleague matrix’s: its Frobenius norm is 2.3⋅10192.3 \cdot 10^{19} at degree twenty and 1.4⋅10491.4 \cdot 10^{49} at forty. Balancing brings those down to 380 and 1,500, by seventeen and forty-five orders of magnitude. The roots do not move. At degree twenty the balanced companion loses 1.7⋅10−21.7 \cdot 10^{-2} where the unbalanced lost 7.6⋅10−37.6 \cdot 10^{-3}; at fourteen, 3.1⋅10−73.1 \cdot 10^{-7} against 7.2⋅10−77.2 \cdot 10^{-7}. Both sit on the conditioning line, which in the monomial basis passes one — the root not determined at all — by degree twenty-four.

So the same step gains three and a half thousand times on one matrix and nothing on the other, and the difference is where each route’s error was made. In the monomial basis the roots are already as accurate as the rounded coefficients allow: the roots are not the coefficients measured the companion route’s error against the conditioning and found them equal. A backward error relative to ∥C∥\|C\| was never the binding term, so reducing ∥C∥\|C\| changes nothing. In the Chebyshev basis the rounded coefficients determine the roots well, and the eigenvalue routine was throwing that away by measuring its backward error against a matrix whose size was set by its last row. Balancing helps exactly where the routine, rather than the representation, was losing the digits.

Balanced is not symmetric found a third case on the Sylvester–Kac matrix, whose entries are exact integers: balancing divided every eigenvalue condition number by about sixty and left their growth with the order untouched. It is the same statement read from the matrix side, and a condition number for one eigenvalue is the quantity both were measuring. Balancing changes a constant; the growth belongs to the problem.

A matrix already balanced

The colleague matrix balanced and not, for roots at Chebyshev points of [1, n] and for roots at the integers, against degreeChebyshev points: 6 4.1·10⁻¹⁵ and 4.1·10⁻¹⁵, 10 8.4·10⁻¹⁵ and 8.4·10⁻¹⁵, 14 10⁻¹⁴ and 10⁻¹⁴, 18 1.9·10⁻¹⁴ and 1.9·10⁻¹⁴, 20 2.6·10⁻¹⁴ and 2.6·10⁻¹⁴, 24 1.9·10⁻¹⁴ and 1.9·10⁻¹⁴, 28 2.7·10⁻¹⁴ and 2.7·10⁻¹⁴, 32 8.7·10⁻¹⁴ and 8.7·10⁻¹⁴, 40 9.1·10⁻¹⁴ and 9.1·10⁻¹⁴ — the two identical at every degree, because their coefficient ratio stays near one and the balancing diagonal is the identity or nearly so. Spreads of the diagonal: 1, 1, 1, 1, 1, 1, 1, 1, 1.1015202530354010⁻¹⁶10⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²degree nworst relative root errorintegers, unbalancedintegers, balancedChebyshev points, botha matrix that is already balanced is left alonethe conditioning decides the rest
Fig. 5 The colleague matrix balanced and not, for roots at Chebyshev points and for roots at the integers. For the Chebyshev points the two curves are one: their coefficient ratio stays near one and the balancing diagonal is nearly the identity.

The control behaves as it should. With roots at the Chebyshev points of [1,n][1, n] the polynomial’s Chebyshev coefficients are all of comparable size, the colleague matrix’s last row is no larger than the recurrence, and balancing leaves it nearly or exactly alone. The root errors balanced and unbalanced agree to every printed digit at every degree, at rounding throughout — 4⋅10−154 \cdot 10^{-15} at degree six, 9⋅10−149 \cdot 10^{-14} at forty. A preprocessing step that does nothing where there is nothing to do is the cheapest kind, and it is why libraries can apply this one without asking.

What degrees six to forty do not show

Every measurement here uses one polynomial family, two root distributions and Francis’s iteration on a dense matrix. The balancing is the classical one, which equalises row and column sums; other norms and other scalings exist and would be expected to behave alike on a matrix this lopsided, which is not tested. The conditioning used is normwise in the coefficient vector, the measure the colleague matrix’s backward error is stated in; a structured analysis that kept the recurrence’s entries exact and perturbed only the last row would predict a smaller error, and the balanced route sits slightly below the normwise line at several degrees, which may be that effect and is not separated here. And the monomial companion’s coefficients are formed in double precision by repeated multiplication rather than rounded once from exact values, so its curve here and the earlier essay’s differ in the last digit from degree eighteen on.

The scaling that buys ten orders found the same kind of free repair for a quadratic eigenvalue problem — a change of variable exact in both directions that brought back every digit a bad choice of units had cost — and a condition number scaling cannot move found where such repairs stop. Both have the shape this one has: a scaling recovers what the representation lost, and nothing the problem itself withholds.

Still open: an adapted basis, and the structured bound

A basis built for equispaced roots. With the second factor gone, the exponential is the conditioning, and the conditioning belongs to the basis as much as to the roots. Orthogonal polynomials on the equispaced points 1,…,n1, \dots, n — the discrete Chebyshev, or Gram, polynomials — are to the integers what Chebyshev polynomials are to Chebyshev points. The prediction with a sign is that Wilkinson’s polynomial expanded exactly in the Gram basis, with its roots taken from the corresponding balanced comrade matrix, keeps every root to within a hundred times the unit roundoff to degree forty, and that the roots’ normwise conditioning in that basis grows by less than two decades across the same range.

The structured bound. If the balanced error is the colleague matrix’s backward error with only the last row perturbed, it should be predicted by a conditioning that perturbs the coefficients alone and leaves the recurrence exact. The prediction is that this structured conditioning times u lies within a factor of three of the balanced route’s worst error at every degree from fourteen to forty, where the normwise line is off by up to a factor of 2.4, and that the two differ most at the degrees where the balanced route sits below the normwise line.

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.

Backward errorChebyshev basisCompanion formConditioningThe QR algorithmScalingSimilarity transformationWilkinson polynomial