The sign is the last digit to go
Worth reading first: The number that decides nothing · An answer that is known · Orthogonal is a number.
The number that decides nothing took the determinant apart as a test of anything. A tenth of the identity has a determinant of and a condition number of one. The Hilbert matrix’s determinant stops being right at and stops being a number at . What it left standing, at the end, was a short list of the things a determinant is exactly right for, and the first was orientation: “the sign, where the input is exact”. For exact input, it said, “the sign is a fact and the whole objection above evaporates.” And it said about a wrong sign, on the Hilbert matrix, that a sign differs from an inaccurate value because it “is a clean, confident integer with no error term”.
Two claims are there, and both can be measured, because a determinant of floating-point numbers has an exact value. Every double is an integer over a power of two, so scaling a matrix of doubles by the right power gives a matrix of integers, and Bareiss’s fraction-free elimination returns its determinant with no rounding. That makes this one of the few places in the subject where every computed answer can be scored against the truth without having to trust a higher precision. It gives the same kind of certainty as an answer that is known, and it needs no special matrix.
The input was exact and the sign was wrong
The most common small determinant in the world asks which side of a line a point is on. Given three points in the plane, subtract the first from the others and take the two-by-two determinant of the differences. Every mesh generator, convex hull and polygon intersection uses that predicate or a close relative. Its input is a set of doubles, exactly stored. Its true answer is one of three values. If the sign is a fact wherever the input is exact, there is nothing left to go wrong.
The classic demonstration, from Kettner and colleagues’ classroom examples, places the point on a small grid of adjacent double-precision values around , and the other two on the diagonal, at and . The true line runs through the grid. Every cell is a question with a precisely known answer.
It is not rounding noise. At a scale of 12 there are 1,300 wrong cells out of 2,304, all of them from returning zero, and they form solid blocks: whole regions where the subtraction has rounded both differences identically, so the two products are the same number. Turn the dial out to 24 and that is 1,712 of 2,304. At a scale of 16 some of the wrong cells are no longer zero; 112 come back with the opposite sign outright. At a scale of one only 24 of the cells are wrong, a thin strip beside the diagonal.
So the first claim fails on the simplest case there is. The input is exact and the sign is not computed exactly, since the two steps between them round. What was true of the permutation matrix and the integer matrix was not that the input was exact, but that the arithmetic stays exact on those inputs. Those are different conditions. Rounding is a property of the operations, and a determinant of order two has three of them before a comparison with zero is even made. On coordinates in the ordinary range of a mesh, those rounding errors are large enough to matter when the point lies within about relative to the line. That sounds like something that happens by accident only, but a mesh generator works precisely by placing points on lines.
A sign does have an error term
The second claim is the more interesting one: that a sign differs from a value because it has no error term. It is true that the returned value is an integer with nothing attached. But nothing about the computation prevents attaching something. The rounding in those three operations is bounded by a fixed multiple of the unit roundoff times the size of the two products, and if the computed difference is larger than that bound then the true difference must have the same sign.
This is Shewchuk’s static filter, and it costs almost nothing, since the two products have already been computed. The test is : add their magnitudes, multiply by the constant, and compare. So the sign does have an error term, which is just computed separately from the sign and read differently.
Take random triples of points in the unit square with the third placed near the line through the first two, at a relative distance of . At up to 36 the filter certifies all 800 triples and the computed sign is right on all of them. At 44 it certifies 99.5 per cent and the computed sign is wrong on two triples of 800. At 48 it certifies 94 per cent and the sign is wrong on seven. And at 52 the certified share falls to 42 per cent with one sign in nine wrong, and at 54 and 56 it levels off near 30 per cent with about one sign in five wrong.
What matters is the column that is empty. Across all ten distances, all 8,000 triples and all five grid maps, the number of cases the filter certified and got wrong is zero. So where the bound speaks it is right, and where it does not speak the program can do something more expensive, usually an exact or adaptive evaluation, which is what a robust predicate library does. Exact arithmetic was never the real cost, since it only runs on the small share of cases that the bound did not settle. Down to thirty-six bits from the line that share is nothing at all, so a program that places its points at random in the square would almost never reach the expensive stage, and a program placing them on lines reaches it for a known and bounded reason.
The grid is the filter’s hard case, and it says so. At a scale of one it certifies 1,872 of 2,304 cells; at four, 138; at 12 and above, none. Even so, it never says something false. It simply declines to speak on the whole grid, because nothing on that grid is far enough from the line.
Where the digits of a larger determinant go
Order two is a special case, and a matrix of larger order brings a factorisation and its growth along with it. So the question extends naturally: when a matrix approaches singularity, what happens to the value and what happens to the sign? They can be separated here, because each can be scored against the exact answer. The matrices are integer rank-deficient matrices of order with entries of about , plus a small perturbation on one row at a chosen relative size . Forty draws are taken at each distance, and LU with partial pivoting computes the determinant.
The value behaves exactly as a condition number says. At order 4 the median relative error is at twelve bits from singular, at 24, at 36, at 42, and 0.1 at 48. The fitted slope between 12 and 42 bits is about 0.30 decades per bit, which is a decade for every 3.3 bits. Since a bit of distance is also a factor of two in the condition number, this is one digit lost for each decade of condition number, the most familiar rule in the subject. Orders 2 and 6 run parallel, a decade below and a little above.
Now the sign, on the same forty draws.
At every distance from six bits to 45 the sign is right on all forty draws, including at 42, where the value has lost most of its digits, and at 45 where the median error is two per cent. At 48, where the median error is ten per cent, the sign is wrong on three draws of forty. At 51 the median error reaches 100 per cent and the sign is wrong on just over half. Beyond that the perturbation is below the spacing of the entries, so it vanishes on the way into the format; the matrix really is singular, and the computed sign is whatever the rounding happens to leave.
So the two failures are not separate. A sign is wrong only when the relative error of the value reaches one, by definition. If the error is below one, the computed value and the true value have the same sign, however few of the digits between them agree. The sign is the leading bit of what the determinant represents, and it is the last one to go. A digit goes for each 3.3 bits of distance, and the sign goes with the last digit and not before. That is the reason it lasts: a floating-point computation that returns a determinant with a single correct digit has returned the correct sign.
That also corrects the reading of the Hilbert matrix in the number that decides nothing, where eight of seventeen sizes from 14 to 30 returned the wrong sign and were read as a coin toss. By then the relative error has long since passed one. Those are exactly the sizes where the pivots are noise and the value has no digits left. A sign is a fair coin past that point because there is no information left anywhere in the answer, not because a sign is a different kind of thing from a value.
The error term for a larger matrix
The same logic gives a filter for any order, though a less sharp one. The elimination’s backward error is bounded by a multiple of times the largest entry that appeared; a perturbation of that size moves the determinant by at most about that much times the product of the other pivots. If the computed value exceeds that, the sign is settled. The bound used here is deliberately crude, a factor of with growth included, since the point is whether something this simple can work.
It works, with a margin. At orders from 2 to 8, the bound certifies nine signs in ten out to 36 to 42 bits from singular. In the 3,800 draws across all orders and distances it certifies one wrong sign, at order 8 and 57 bits, on a matrix that rounding had already made exactly singular, where the truth is zero and any sign is wrong. That is a useful warning about the difference between this first-order estimate and Shewchuk’s proved constant, and it is why a real predicate library derives its bound with care. The first wrong sign of any kind arrives at 45 to 51 bits. So there is a window of between six and twelve bits, or two to four decades, in which the sign is right and this bound cannot say so. A sharper bound, or one using the pivots more carefully, would shrink that window. But its position does not move much with the order, so asking about the sign is nearly as good at order 8 as at order 2, which the growth of the value’s constant with order did not have to allow.
What can be said for this: it gives a program three outcomes instead of two. Without a bound the program has a sign and no information. With one it has a sign it may rely on, or a statement that the matrix lies within a stated distance of a singular one, and that is what a caller who asked about a sign usually needed to know anyway. For such a caller, as a rule that is correct and unusable points out from the other side, an unstable formula for a value and a stable answer to a decision can live in the same expression.
What it does to the list of things a determinant is good for
The original essay’s position is mostly strengthened by this. The value still decides nothing about singularity. On a tenth of the identity its size is not the distance from anything, and every intermediate of a fraction-free elimination still has its digits to carry. But its one permitted use was stated with too little care in one direction and too much in the other. An exact input does not make the sign exact, and that matters in geometry code, where people were told otherwise. And a floating-point sign can be read with confidence well past the point where its value has stopped being useful, when a bound says so.
What a determinant does not determine makes the integer version of this same point, in which a determinant does not fix the matrix’s structure. Here it does not fix its own arithmetic, but its sign tells more than its size can. And deciding that a zero has arrived describes what happens when a program has to answer the third case: the question “is it exactly singular” has no floating-point answer in general, and this bound’s silence is a precise statement of that same limit.
The word to take from this is certification rather than accuracy. Everything else said about a determinant here is a statement about how much of a real number survives. A sign is a discrete answer with a certificate of its own, and a discrete answer can be guaranteed where a real number can only be approximated. An inertia count gives a discrete answer of the same kind, an integer that is either right or wrong, and can be proved right.
Where this stops
The matrices of the singular sweep are integer rank-deficient matrices plus one perturbed row. That gives them one small singular value, which is the simplest way for a matrix to approach singular. A matrix with several small singular values has a much smaller determinant for the same smallest one, and its value and sign may fail in another pattern; a Hilbert matrix is such a case. Forty draws can detect a rate of about one in forty and not less, so zero wrong signs at 42 bits means under about one in ten at reasonable confidence, not none.
The grid experiment is at one point, with far points on the diagonal, and the block pattern is specific to that arrangement. Exact arithmetic here is via BigInt, whose speed says nothing about a robust predicate library’s real cost, and that cost has not been measured. And all measurements assume round-to-nearest, whereas the filter’s constant has to be derived again for a directed mode.
Still open: several small singular values, and how often exact arithmetic runs
More than one small singular value. The sweep above has one small singular value. Give the matrix two, each at a distance of . The determinant then shrinks by twice as many bits, and a condition number sees only one of them. The prediction with a sign is that the sign still fails only when the value’s relative error reaches one, and that this happens at about half as many bits from singular as the first sweep’s, near 24 at order 4, whereas the crude bound’s limit moves by less. The window between the bound’s limit and the first wrong sign would then shrink or close.
What an adaptive predicate spends. A filter passes the great majority of random triples, and on points placed near lines a good share reach an exact stage. The prediction is that on the point sets a Delaunay triangulation of a regular grid produces, where many triples are exactly collinear, the static filter passes under one call in three, and that a second, tighter stage passes most of the remainder, so that fewer than one call in twenty needs exact arithmetic. If so, what costs most in robust geometry is a bookkeeping stage rather than big numbers.
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.
- A bound on every intermediate at once — both name determinant, exact ground truth, fraction-free elimination
- A multiplier is a force — both name condition number, exact ground truth, unit roundoff
- An answer with no error in it — both name condition number, exact ground truth, fraction-free elimination
- One number that has to be right — both name condition number, exact ground truth, unit roundoff
- The pivot is in every product — both name determinant, exact ground truth, fraction-free elimination
- The sum can be single, the residual cannot — both name condition number, exact ground truth, unit roundoff
Named objects
A flat tag is an object no other essay names yet.
Condition numberDeterminantExact ground truthFraction-free eliminationLU factorisationUnit roundoff