Theme

The thread: Identical algebra, different arithmetic — page 5

Essays 97 to 108 of the 124 on this theme, in the same order.
110¹05101520253035largest singular value over the secondstep, medianholding one vector, partssecond value convergesshort recurrence, partsfirst value convergessix problems, 72 draws · this blur, 24the repair goes back to the blur's own step Methods that were designed apart

The hold ends where the blur parted

Holding conjugate gradients' basis off its first converged Ritz vector failed on the blurs because their second value converges a step or two behind the first, and it was predicted to work on an operator whose top singular value stands at twice the second. At twice the second it fails on all seventy-two draws: the delay is eight steps against a gap of ten. It starts to succeed only near four times, and it does so without the repaired run going one step further. The repaired run parts at about step 30, 20 and 14 on the three blurs at every ratio from 1.25 to 32, within two steps of where the unaltered blur parted to begin with. Pulling the top value away moves the failure earlier; the repair only takes it back.

04812162024283210⁻¹10¹10³10⁵10⁷10⁹10¹¹10¹³10¹⁵power iterationsdraws' spread over partitionings' spreaddecay 0.7decay 0.78decay 0.82decay 0.88decay 0.94floored at a tentha factor of 10¹⁴ is one setting The answer that depends on the machine

The seed stops mattering first

A randomised low-rank approximation's error moved by 31 per cent between draws and by 10⁻¹⁵ between partitionings of one draw, so a seeded method was called reproducible in the term that matters by a factor of 10¹⁴. That is true at no power iterations. Each pass cuts the spread between draws by a fixed factor and leaves the partitioning's spread where it was, so the two lines cross: at two passes on a decay of 0.7, at sixteen on 0.94. Past that point a recorded seed settles nothing a recorded machine does not, and a bitwise test is the only thing left that can tell two runs apart. The vectors take longer: at sixteen passes the error has settled to rounding while the leading subspace still differs between draws by 3·10⁻⁵.

012310⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³the eigenvalue's angle, in radiansdistance from the unit circlegeneral, inside the circlegeneral, outsidestructuredorder 8 · κ(C) = 10³ · floored at 10⁻¹⁷a growing mode that is not there The eigenvalue problem that is not linear

The circle a general solver leaves

A palindromic quadratic's eigenvalues come in reciprocal pairs, and on a real chain that made the small half one division from being right. A pair on the unit circle is the other case, and there reciprocity is a statement that the mode neither grows nor decays. A general solver owes that nothing: it moves unit-modulus eigenvalues off the circle by 10⁻⁷ at a leading factor's condition number of a million, and at a thousand it puts six of sixteen outside by more than rounding, which is a growing mode that is not there. A route through the definite pencil in λ + 1/λ stays within 2·10⁻¹⁶ at every conditioning, and its angles are nine decades better. Where two eigenvalues collide at λ = 1 the structure protects nothing, and both routes fail together.

110¹10²10³10⁴10⁵10⁶110¹10²10³10⁴10⁵10⁶products‖QᵀQ − I‖ in units of the roundoffone factor repeateda pool of 4a pool of 64a pool of 1024a fresh factor each timebinary32 · order 3 · five drawsa fixed defect is a straight line Orthogonality, measured

A repeated rotation drifts in a straight line

Composing rotation matrices drifts away from orthogonality, which is why graphics and robotics code re-orthonormalises. Rounding errors have no preferred sign, so a product of k rotations should lose orthogonality like the root of k, and it does when every factor is new: slope 0.52 over a million products. Multiply by the same factor every step, as a fixed-step integrator does, and the slope is 1.00. The factor's own rounding is one defect met in the same direction every time. At a million products in binary32 that is 622,000 units of roundoff against 2,400, a loss of 3.7 per cent. One polar step removes it at any period from ten products to ten thousand, the error in the rotation falling twenty times and hardly moving with how often it is run. Gram–Schmidt every ten products is six times worse, and for a reason that is not rounding.

10¹10²10³10⁴10⁵10⁶10⁷10⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³10⁻¹condition numberrelative error of the solutionnormal equationsQRu·κtan θ = 1 · 24 × 6 · five drawsagainst exact arithmetic, on the stored data Least squares, and the road not to take

Where QR pays the square

The road through the normal equations squares the condition number, and the road through QR keeps every step orthogonal, so the condition number is untouched. That is true of the triangular system QR ends in, and it is not a statement about the answer. Measured against the exact solution of the stored data, QR's error in a least-squares solution goes as the square of the condition number too, once the data lie well away from the column space: 2·10⁻⁴ at κ = 10⁷ and a tangent of one, five orders above the condition number's own reading. The residual does not pay it. And the normal equations' famous disadvantage is seven decades on a consistent system, one decade at a tangent of one, and nothing at all at a thousand.

10²10⁴10⁶10⁸10¹⁰10¹²10¹⁴10⁻¹⁸10⁻¹⁶10⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²condition numberbackward error, median of twelveinverse, b = Axinverse, b randomLU, b = Axorder 30 · matrices with known singular valuesthe earlier sweep is the red line only Elimination, and the swap

The test that made the answer small

Solving by a computed inverse was measured twelve orders of magnitude less backward stable than solving by LU at a condition number of 10¹⁴, on a right-hand side built as b = Ax from a random x. That construction is how a known answer is arranged, and it makes the answer about as small as it can be. On a random right-hand side the inverse route's backward error is 2·10⁻¹⁷, the same as LU's, at every condition number measured. The backward error is about a tenth of the roundoff over ρ, the answer's size over its largest possible, and across 200 random right-hand sides ρ never falls below 0.016. The instability is real, and it belongs to right-hand sides whose answers are small, which is a class that includes most tests and many applications.

right, and certifiedright, not certifiedreturned zero, wronglythe opposite sign1300 of 2304 wrong0 certifiedfirst coordinate, in steps of 2⁻⁵³ from ½a grid of adjacent doubles · the true line is the diagonala pattern, not noise Two errors, and whose fault they are

The sign is the last digit to go

The number that decides nothing allowed the determinant one use: its sign, which it called a clean integer with no error term, and a fact wherever the input is exact. The input to the classic orientation test is exact, and on a grid of adjacent doubles the sign comes back wrong on 1,712 of 2,304 points, mostly as zero. But a sign does have an error term. A bound costing three multiplications certifies every random triple down to thirty-six bits from the line and is never wrong on anything measured, and on a matrix of order four the sign is right on every draw at forty-five bits from singular, where the value has lost all but two digits. The value goes a digit at a time, and the sign is the last digit.

4681012141610⁻²10⁻¹110¹10²10³10⁴k, the tail's entries are two to the minus kerror in units of the roundoffsquares added in ordersquares added pairwisebinary32 · length 4,096 · floored at a hundredtha cliff at almost every depth The arithmetic underneath

Every equal tail has a cliff

A scaled binary32 norm of one entry of size one and 4,095 entries of two to the minus twelve is wrong by 2,047 units of roundoff, and that was read as a depth: a square half a spacing below the running sum is lost. It is not a depth. An equal tail at 0.003, eight bits shallower, loses 1,965 units, and 88 per cent of all depths between four and twelve lose more than a hundred. The error is one addition's rounding repeated once per entry, so a test that counts small entries misses nearly all of it, and a spread tail does not average it away. Adding the same squares pairwise, with the same number of additions, leaves under five units on everything measured.

110¹05101520253035ratio of the first to the second, and of the second to the thirdstep, medianholding two, partsthird convergesholding one, partssecond convergesshort recurrence, partssix problems, 72 draws · this blur, 24each hold waits for the next value Methods that were designed apart

The lag belongs to the value it follows

Conjugate gradients on a blur, held off its first converged Ritz vector, parts from the reorthogonalised run a fixed lag after the second value converges, and the account offered was one clock per value with the blur setting the lag. Held off two vectors, it parts on the third value's clock on all 72 draws at every ratio measured, as predicted. Held off one, it meets the second value's clock only at the ratio the prediction named, and misses a third of the draws at two and at eight. The reason is that the lag is not the blur's: it is 11 steps after a second value that stands at 1.5 times the third and 4 after one at eight, on every blur, so lifting the second value moves the parting about twice as far as it moves the convergence.

10²10³10⁴10⁵10⁶110¹10²10³10⁴10⁵10⁶number of productsloss of orthogonality, in unitsnearest binary32best of 512 neighboursgreedy, within 8 ulpsrounded afresh at randombinary32 · order three · rotation 1 of fivethree lines and a walk Orthogonality, measured

A rounding chosen once is still repeated

One binary32 rotation multiplied into itself a million times loses orthogonality in a straight line, 622,126 units of roundoff on the first of five rotations, because its rounding defect is the same every time. The prediction was that choosing the best of the factor's representable neighbours would cut that rate tenfold and leave the angle alone. The best of 512 neighbours cuts it by 1 to 5 per cent. A greedy search eight ulps wide cuts it at most by half, and where it does, it moves the factor off the rotation and multiplies the angle's error by up to five. What works is to stop repeating the rounding: rounded afresh at random each product, the same factor loses 1,717 to 3,377 units at a million, and its angle is two hundred times nearer the truth than any fixed choice.

0.1110columns of AX = I‖AX̂ − I‖0.13‖X̂A − I‖5.67the transpose's columns‖AX̂ − I‖6.72‖X̂A − I‖0.12W L = U⁻¹‖AX̂ − I‖0.38‖X̂A − I‖0.17residual over ‖A‖‖X̂‖, in units u = 2⁻⁵³order 30 · geometric singular valuesthe sides are not what the equation fixes Elimination, and the swap

The other side was small too

An inverse formed by columns, from AX = I, leaves AX̂ − I at a tenth of a unit of roundoff, and that tenth turns out to be the constant in the law that put the inverse route's backward error at about u/ρ. Formed the mirror way, from the transpose, the two sides swap: X̂A − I goes to a tenth and AX̂ − I to almost seven units, so the backward error on a random right-hand side rises forty-fold, as predicted, and the forward error on b = Ax falls from fourteen times LU's to 1.7. LAPACK's way, U⁻¹ then W L = U⁻¹, was the form the prediction was about, and it does not trade at all: both sides stay under half a unit at every condition number, so it has the forward error of the one and nearly the backward error of the other. Partial pivoting keeps L at a condition number near two hundred whatever A is, and that is the only factor this form solves against on the side it did not ask for.

33.310⁻⁴10⁻³10⁻²10⁻¹1log₁₀ numbers storeddistance to the dominant eigenvalueArnoldi, linearisedprojected quadraticper number heldstorage, linearised2080storage, second-order1040Ritz values, linearised26Ritz values, second-order52half the storageand twice the approximations Iterating, instead of factorising

A Krylov space for a problem that is not linear

A quadratic eigenvalue problem has no matrix to build a Krylov space out of. The recurrence that builds one anyway stores half as many numbers, returns twice as many Ritz values — and stops being a basis at twenty vectors while the answer it gives keeps improving.

All themes