Generator

two-recurrences

One function in the lsqrgmres library, called 9 times across 8 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 26 claims it put to the test while drawing them, and where it stands against the rule this site is named for.

At its defaults it draws steps to a relative error of 10⁻⁶, on one 60×12 problem at five condition numbers. Two curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 16 and 16 steps; at κ = 10¹⁰ they cost 110 and 209.

two-recurrences is one function in lib/figures/lsqrgmres.js — the other two krylov regularisers — one sequence, two recurrences, and a weight that stops being a function of σ. Everything below came out of it during this build, at arguments taken from the essays rather than invented for this page. A figure here is the figure a reader meets in an essay, and if the generator changes, this page changes with it.

At its defaults

Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.

Steps to a relative error of 10⁻⁶, on one 60×12 problem at five condition numbersTwo curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 16 and 16 steps; at κ = 10¹⁰ they cost 110 and 209.10²10⁴10⁶10⁸10¹⁰0285684112140168196224condition numberstepsnormal equationsbidiagonalisationone sequence, two costssteps at κ = 10², both16at κ = 10⁶, ratio1.1at κ = 10¹⁰, ratio1.9the same iterates in the algebraand twice the work at κ = 10¹⁰

Two curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 16 and 16 steps; at κ = 10¹⁰ they cost 110 and 209.

target: 0.00001

The arguments are the ones A rate that is known in advance passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

Steps to a relative error of 10⁻⁵, on one 60×12 problem at five condition numbersTwo curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 15 and 16 steps; at κ = 10¹⁰ they cost 105 and 194.10²10⁴10⁶10⁸10¹⁰0275481108135162189216condition numberstepsnormal equationsbidiagonalisationone sequence, two costssteps at κ = 10², both15at κ = 10⁶, ratio1.1at κ = 10¹⁰, ratio1.8the same iterates in the algebraand twice the work at κ = 10¹⁰

Two curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 15 and 16 steps; at κ = 10¹⁰ they cost 105 and 194.

target: 0.0001

The arguments are the ones An orthogonalisation nobody calls one passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

Steps to a relative error of 10⁻⁴, on one 60×12 problem at five condition numbersTwo curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 15 and 15 steps; at κ = 10¹⁰ they cost 103 and 169.10²10⁴10⁶10⁸10¹⁰0265278104130156182208condition numberstepsnormal equationsbidiagonalisationone sequence, two costssteps at κ = 10², both15at κ = 10⁶, ratio1.1at κ = 10¹⁰, ratio1.6the same iterates in the algebraand twice the work at κ = 10¹⁰

Two curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 15 and 15 steps; at κ = 10¹⁰ they cost 103 and 169.

target: 0.000001

The arguments are the ones One sequence and two recurrences passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

Steps to a relative error of 10⁻⁶, on one 60×12 problem at five condition numbersTwo curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 16 and 16 steps; at κ = 10¹⁰ they cost 110 and 209.10²10⁴10⁶10⁸10¹⁰0285684112140168196224condition numberstepsnormal equationsbidiagonalisationone sequence, two costssteps at κ = 10², both16at κ = 10⁶, ratio1.1at κ = 10¹⁰, ratio1.9the same iterates in the algebraand twice the work at κ = 10¹⁰

Two curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 16 and 16 steps; at κ = 10¹⁰ they cost 110 and 209.

target: 0.001

The arguments are the ones The dimension does not appear passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

Steps to a relative error of 0.001, on one 60×12 problem at five condition numbersTwo curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 15 and 15 steps; at κ = 10¹⁰ they cost 101 and 159.10²10⁴10⁶10⁸10¹⁰021426384105126147168condition numberstepsnormal equationsbidiagonalisationone sequence, two costssteps at κ = 10², both15at κ = 10⁶, ratio1.1at κ = 10¹⁰, ratio1.6the same iterates in the algebraand twice the work at κ = 10¹⁰

Two curves against the condition number on a logarithmic horizontal axis, with four seeds drawn at each. The two recurrences compute the same iterates in exact arithmetic. At κ = 10² they cost 15 and 15 steps; at κ = 10¹⁰ they cost 101 and 159.

What it checked while drawing

Every figure above asserted its own claims on the way to being drawn, and a claim that failed would have failed the build rather than drawn a wrong picture. Those assertions used to leave no trace at all: a passing one returned true and the only evidence the figure had checked anything was that nothing crashed. The list below is what they actually said, collected by running this generator with an observer installed — not a description of what it is believed to check.

26 distinct claims across 5 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.

a matrix tall enough for the least-squares problem to be one

a width the dense reference is affordable at

an accuracy target above the forward-error floor

and not on an ill-conditioned one

both methods reach 0.001 at κ = 100

both methods reach 0.001 at κ = 10¹⁰

both methods reach 0.001 at κ = 10⁴

both methods reach 0.001 at κ = 10⁶

both methods reach 0.001 at κ = 10⁸

both methods reach 10⁻⁴ at κ = 100

both methods reach 10⁻⁴ at κ = 10¹⁰

both methods reach 10⁻⁴ at κ = 10⁴

both methods reach 10⁻⁴ at κ = 10⁶

both methods reach 10⁻⁴ at κ = 10⁸

both methods reach 10⁻⁵ at κ = 100

both methods reach 10⁻⁵ at κ = 10¹⁰

both methods reach 10⁻⁵ at κ = 10⁴

both methods reach 10⁻⁵ at κ = 10⁶

both methods reach 10⁻⁵ at κ = 10⁸

both methods reach 10⁻⁶ at κ = 100

both methods reach 10⁻⁶ at κ = 10¹⁰

both methods reach 10⁻⁶ at κ = 10⁴

both methods reach 10⁻⁶ at κ = 10⁶

both methods reach 10⁻⁶ at κ = 10⁸

matmul shapes agree

the two cost the same on a well-conditioned problem

Against the rule

It draws a decomposition and prints its residual. It calls cgls, and every figure above carries the badge — which residualcheck verifies by looking for it in the emitted SVG rather than by finding the call that builds one. A badge that is constructed and then left out of the body is the failure that check exists for.

Across the library: the rule bites on 70 of 151 generators — 55 print a residual and 15 are exempt with a published reason; 81 factorise nothing. Read from lib/residual-rule.js, which is the same body the gate enforces from, and the gate's last check fails the build if this page and it disagree about any generator.

Where it is called

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

Iterating, instead of factorising

A rate that is known in advance

On the model problem, Jacobi contracts by cos(π/(n+1)) per step, Gauss–Seidel by its square, and optimally relaxed SOR by a number given in closed form. Three rates, all known before anything runs, and all measurable against what runs.

Iterating, instead of factorising

An orthogonalisation nobody calls one

Conjugate gradients are derived as a minimisation and behave as an orthogonalisation, which is why the finite-termination property in every textbook is not a property the method has in floating point.

Iterating, instead of factorising

One sequence and two recurrences

CGLS and LSQR compute the same iterates — the minimiser over a space is unique, so there is nothing to choose between them in the algebra. At κ = 10⁶ they cost 42 steps and 47. At κ = 10¹⁰ they cost 110 and 209, across four seeds, and the quantity that separates them is the orthogonality of a basis neither of them keeps.

Orthogonality, measured

Orthogonal is a number

"Q is orthogonal" is a claim about a measurable quantity, ‖QᵀQ − I‖, and on the eight-by-eight Hilbert matrix two standard algorithms return 10⁻¹⁵ and 1 for it. The one that returns 1 still reconstructs the matrix perfectly, which is why nothing warns you.

Randomised, and the guarantee that changes kind

The dimension does not appear

A random projection preserves the lengths of a set of vectors to within a distortion that depends on how many vectors there are and not on how many coordinates each one has. That is the fact the whole field rests on, and it is genuinely surprising.

Iterating, instead of factorising

The rate the condition number predicts

Conjugate gradients converge at a rate governed by the square root of the condition number. That is a bound rather than an estimate, it is provable, and it is loose enough that provisioning iterations from it wastes nine out of ten.

Least squares, and the road not to take

The road that squares the problem

The normal equations are the first method every course teaches and the method no library uses. Forming AᵀA squares the condition number, and below ε = √u it does not degrade — it produces a matrix that is exactly singular, from data that was perfectly usable.

Orthogonality, measured

Two Gram–Schmidts

One argument changes. Classical Gram–Schmidt projects the original column onto each previous direction; modified projects what is left of it. In exact arithmetic the coefficients are identical. In floating point they differ by eight orders of magnitude in the thing that matters.

The whole library · All essays · What must fail