Generator

squaring-cost

One function in the funm library, called 11 times across 9 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 7 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 relative error of scaling and squaring against the number of squarings, μ = 4. Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 6·10⁻¹²; the best is 6.88·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.

squaring-cost is one function in lib/figures/funm.js — matrix functions — the definition that is not a method, and the vector that was wanted. 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.

Relative error of scaling and squaring against the number of squarings, μ = 4Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 6·10⁻¹²; the best is 6.88·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.0246810121410⁻¹⁷10⁻¹⁶10⁻¹⁵10⁻¹⁴10⁻¹³10⁻¹²10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸squarings, srelative error against the closed formbest: s = 2the approximant is out of rangethe squarings amplifyboth sides costerror at s = 06·10⁻¹²best, at s = 26.9·10⁻¹⁶error at s = 153.2·10⁻¹²‖A‖ / 2^s at the best1.1the squarings are exact in the algebraand each one doubles the rounding

Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 6·10⁻¹²; the best is 6.88·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.

mu: 4

The arguments are the ones A coin flip that fixes the average 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.

Relative error of scaling and squaring against the number of squarings, μ = 4Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 6·10⁻¹²; the best is 6.88·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.0246810121410⁻¹⁷10⁻¹⁶10⁻¹⁵10⁻¹⁴10⁻¹³10⁻¹²10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸squarings, srelative error against the closed formbest: s = 2the approximant is out of rangethe squarings amplifyboth sides costerror at s = 06·10⁻¹²best, at s = 26.9·10⁻¹⁶error at s = 153.2·10⁻¹²‖A‖ / 2^s at the best1.1the squarings are exact in the algebraand each one doubles the rounding

Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 6·10⁻¹²; the best is 6.88·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.

mu: 12

The arguments are the ones A parameter chosen on a smaller problem 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.

Relative error of scaling and squaring against the number of squarings, μ = 12Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 5.55·10⁻¹¹; the best is 9.08·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.0246810121410⁻¹⁷10⁻¹⁶10⁻¹⁵10⁻¹⁴10⁻¹³10⁻¹²10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸squarings, srelative error against the closed formbest: s = 2the approximant is out of rangethe squarings amplifyboth sides costerror at s = 05.6·10⁻¹¹best, at s = 29.1·10⁻¹⁶error at s = 153.2·10⁻¹²‖A‖ / 2^s at the best3the squarings are exact in the algebraand each one doubles the rounding

Each point computes e^{A/2ˢ} by a Padé approximant and squares it s times, against a closed-form exponential. At s = 0 the approximant is being used far outside its range and the error is 5.55·10⁻¹¹; the best is 9.08·10⁻¹⁶ at s = 2; at s = 15 it has risen again to 3.16·10⁻¹². The right-hand rise is the squaring phase amplifying its own rounding, which is why a library chooses s from ‖A‖ rather than taking as many as it can afford.

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.

7 distinct claims across 3 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 size the sweep of exponentials can afford

a superdiagonal the closed form stays representable at

and too many costs as well

LU is for square matrices

matmul shapes agree

the best number of squarings is inside the sweep

too few squarings costs

Against the rule

The rule does not apply to it. It factorises nothing, so there is no residual it could be withholding. That is worth stating rather than leaving blank: a site that reported the rule as satisfied by every generator would be counting mostly generators the rule never reached.

Across the library: the rule bites on 92 of 198 generators — 77 print a residual and 15 are exempt with a published reason; 106 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.

The arithmetic underneath

A coin flip that fixes the average

Add 0.1 to 256 a thousand times at eight significand bits and the answer is 256. Not approximately — the total never moves, not once, and no error bound says so. Round up one time in twenty instead of never, and it arrives at 348 against a true 356.

Eigenvalues, singular values, rank

A function of a matrix is not a function of its entries

Everybody learns that f(A) means diagonalise, apply f to the eigenvalues, undiagonalise. That is a definition, not a method. On a matrix seven picometres from a defective one — with exact eigenvalues and eigenvectors from a closed form — the definition returns an answer wrong by sixty-five orders of magnitude, and a method that never mentions an eigenvalue returns the right one.

Methods that were designed apart

A parameter chosen on a smaller problem

Inside a hybrid method the regularisation parameter is chosen on a 25×24 problem rather than a 64×64 one. The rule that reads a residual transfers exactly; the rule that reads a trace is biased by exactly two grid steps at twenty-four steps and one at forty, at every noise level from 10% to 0.1%.

Regularisation, and the answer that is chosen

Choosing without knowing

Three published rules for choosing a regularisation parameter, scored against an oracle that requires the exact answer and is therefore not a method. Generalised cross-validation lands on the oracle's λ exactly; the discrepancy principle costs 6%; the L-curve costs 129%. And told a noise level ten times too small, the discrepancy principle's error goes from 0.112 to 10,449.

Methods that were designed apart

Four knobs and one floor

A truncation, a Tikhonov parameter, a step count and a randomised rank, on one problem with an answer that is known. Their best errors are 0.1445, 0.1406, 0.1426 and 0.1449 — a spread of 3% across four methods that share no arithmetic.

Iterating, instead of factorising

The diffusion that makes the answer exact

Upwinding adds h/2 of artificial diffusion. Central differencing adds none. Add ε·ξ·Pe with ξ = coth(Pe) − 1/Pe and the computed solution is the exact one at every grid point, to 2.4·10⁻¹⁷ — at every Péclet number, on the problem it was derived from and on no other.

The arithmetic underneath

The direction the error leans

The size of one rounding error is set by the precision. How ten thousand of them combine is set by something else entirely — the rounding mode — and the fitted exponents are 0.47 for round-to-nearest and 1.01 for round-toward-infinity, on identical data at identical precision.

The arithmetic underneath

The order they are added in

Addition is associative in the algebra and is not associative in the arithmetic. The same million numbers, added in a different order, give answers that differ in the third significant figure — and the fix is not a wider float, it is a different order.

Eigenvalues, singular values, rank

The series that has to be squared back

The Taylor series for the matrix exponential is not wrong — every term is computed correctly — and on Moler and Van Loan's two-by-two its largest term is 5.4 million times the answer it sums to. The method that replaces it scales the matrix down and squares the result back, and both halves of that sentence cost: too few squarings and the approximant is out of range, too many and each one doubles the rounding.

The whole library · All essays · What must fail