The curve as an equation

Doubling is cheaper than adding

Multiplying an angle by eight costs three gadgets and multiplying it by seven costs six. The cost of an integer multiple follows the binary expansion of the integer and not its size — which is why the arithmetic in a compiled machine grows like d log d while everything else grows like the fourth power.

Assumes Four bars that add two angles.

A term of the expansion asks for mα+nβ+φm\alpha + n\beta + \varphi, and the gadgets supply addition, negation and doubling. Getting from those to an arbitrary whole-number multiple is a small piece of arithmetic with a surprising answer.

The obvious way, and what it costs

Multiply by nn by adding the angle to itself n1n-1 times. Each addition is a mean and a reflector — two gadgets, five bars, three joints. For n=8n = 8 that is seven additions, fourteen gadgets, thirty-five bars.

That is the construction anybody writes first, and it is linear in nn. For a curve of degree five it would mean multiplying up to five, which is four additions, and nobody would notice. It matters here for a different reason: it is the wrong shape, and the right shape says something about what these machines are.

the mean, solvedA rhombus on two links from one pivot. Its far vertex is the vector sum of two equal lengths, so the diagonal bisects the angle between them, for the same reason a rhombus has equal sides. The relation it satisfies is **(θ₁, θ₂) ↦ (θ₁ + θ₂) / 2**, and across a sweep of 41 positions the worst departure from it is 3.0e-15 radians. Every joint here is the output of a Newton–Raphson solve on the bar lengths; nothing is placed by the formula the picture is about.θ₁θ₂the bisector(θ₁, θ₂) ↦ (θ₁ + θ₂) / 2positioned by solving, not by drawing
Fig. 1 The other rhombus: two links from a pivot and two more closing it, with the diagonal along the bisector.

Doubling is one gadget

The reflector reflects an input in a mirror, and both of its arguments are angles. Give it the input 00 — the frame direction, a link that is simply bolted down — and the mirror θ\theta, and the output is

2θ0=2θ.2\theta - 0 = 2\theta.

One reflector. Three bars, one rail, two joints. A doubling costs less than half an addition, because the mean is not needed: there is only one angle going in.

That single observation reorganises everything, because a whole number can be reached by doubling and adding one. Write nn in binary and walk it: 2k2k is one doubling of kk, and 2k+12k+1 is one addition of kk’s result and the original angle. The number of steps is the number of bits, not the size of the number.

What it costs to multiply an angle. Multiplying an angle by n is done by doubling and adding — 2k is one reflector applied to k, and 2k+1 is one addition of k's result and the original — so the cost follows the binary expansion of n and not n itself. Eight costs three doublings; seven costs six gadgets, twice as much, for a smaller number. The other line is what a chain of n−1 additions would cost. The difference matters because the highest multiple a curve of degree d needs is d, so the arithmetic in a compiled machine grows like d log d while the carrying grows like d⁴ — which is why the arithmetic is not what makes these machines large.
Fig. 2 The gadget count for each multiple, against what a chain of n−1 additions would cost. Eight is three doublings; seven, a smaller number, costs six gadgets.
the reflector, solvedA rhombus whose far vertex is held on a line through the pivot. One side is the input, the line is the mirror, and the other side comes out reflected in it — which is where negation, doubling and addition all come from. The relation it satisfies is **(μ, θ) ↦ 2μ − θ**, and across a sweep of 41 positions the worst departure from it is 1.3e-13 radians. Every joint here is the output of a Newton–Raphson solve on the bar lengths; nothing is placed by the formula the picture is about.input θ2μ − θon the mirror(μ, θ) ↦ 2μ − θpositioned by solving, not by drawing
Fig. 3 The one gadget all of it is built from, with the frame direction as its input and the angle to be doubled as its mirror.

The jaggedness is the point

Look along that lower line and it does not rise smoothly.

Eight costs three gadgets — double, double, double. Seven costs six — reach six by doubling three, and three by adding two and one, with an addition at each odd step. Seven is smaller than eight and costs twice as much, and the same happens at every power of two: sixteen is four gadgets and fifteen is eight.

This is the ordinary behaviour of addition chains and it is not a quirk of the mechanism. What is worth noticing is that a linkage is showing it. The cost of a mechanical operation is following the binary representation of a number, which is not something a bar knows about; the connection runs through the fact that the only two operations available compose the way arithmetic composes.

The site has met a related pattern once before, in a different field. A clock train is a factorisation: a ratio of 3600:1 is realised as a product of tooth ratios, and which factorisation is chosen decides how many wheels the movement has. There the arithmetic is multiplicative and the mechanism is gears; here it is additive and the mechanism is rhombi. Both are cases of a machine’s size being set by a number-theoretic property of its specification rather than by the specification’s magnitude.

The four gadgets, against their closed forms. Each construction driven across its own working range and its output compared with the formula it is supposed to satisfy — an angle added, an angle bisected, an angle reflected, a direction carried. The bars are decades above 10⁻¹⁷. None of these relations is fitted or approximated: they hold because a rhombus has four equal sides and a parallelogram has two pairs, and the measurement is here to say that the machinery built on them inherits nothing worse than rounding. Each gadget's range stops short of its own singular configuration, which has its own figure.
Fig. 4 The gadgets against their closed forms. A doubler and a negator are the same four bars with the roles of mirror and input exchanged.

Negation, and the sign that costs one gadget

Half the frequency pairs in a typical expansion have a negative entry — the cubic’s include (1,2)(1,-2) and (2,1)(2,-1) — so negation is not an afterthought.

It is one reflector: reflect the input in the frame direction and the output is θ-\theta. The same three bars and a rail that double, wired the other way round, with the roles of mirror and input exchanged. Whether a gadget doubles or negates is a fact about which of its two arguments is the moving one, and the two machines are identical objects.

There is a small piece of bookkeeping in it worth stating because the compiler gets it right and a reader working by hand would not. A negative multiple k-k is built as the negation of +k+k, so it shares the whole chain that produced +k+k and adds one gadget. A machine needing both 2β2\beta and 2β-2\beta therefore contains one doubler and one negator, not two doublers. On the cubic that saves five gadgets out of twenty-three.

The alternative — building k-k directly by negating first and then doubling — costs the same and produces a different machine. Both are correct and the compiler picks one and stays with it, because a construction that made a different choice on different runs would produce different bar counts for the same curve, and every count in this field would then be a count of whichever machine happened to be built that day.

the rigid offset, solvedA point carried rigidly on a link, at a fixed angle to it and a fixed fraction of its length — physically a triangular link, and the only one of the four with no second assembly, because a rigid attachment has one place to be and a pair of bars has two. The relation it satisfies is **θ ↦ θ + φ**, and across a sweep of 41 positions the worst departure from it is 2.2e-16 radians. Every joint here is the output of a Newton–Raphson solve on the bar lengths; nothing is placed by the formula the picture is about.input θθ + φθ ↦ θ + φpositioned by solving, not by drawing
Fig. 5 The gadget a sign costs: a rigid offset, which adds a fixed angle and is one four-bar. Negating a term is that offset at half a turn, so the arithmetic of a minus sign is the same hardware as the arithmetic of any other constant.

Sharing, which is where the real saving is

A curve of degree dd needs multiples of α\alpha up to dd and multiples of β\beta up to dd — but it needs several of them, and it needs some of them more than once.

The cubic’s eight terms use the frequency pairs (0,1)(0,1), (1,0)(1,0), (0,3)(0,3), (1,2)(1,-2), (1,2)(1,2), (2,1)(2,-1), (2,1)(2,1) and (3,0)(3,0). Written out, that is: α\alpha once, 2α2\alpha twice, 3α3\alpha once, β\beta once, 2β2\beta twice, 3β3\beta once. If each term built its own multiples the machine would contain three separate doublers producing 2α2\alpha.

It contains one. The multiples are computed once and shared, cached by which multiple they are, and every term that needs 2α2\alpha takes the same link. That is the ordinary optimisation any compiler makes — a shared subexpression — and it is available here because a link at a fixed pivot can be an input to any number of gadgets at that pivot without being copied.

A link is a value that can be read many times. That is the one respect in which a linkage behaves like a program, and it is worth naming because so much of this field is about the respect in which it does not: a link cannot be read anywhere but at its own pivot, and every reading somewhere else costs a parallelogram per unit of distance.

Every curve in the catalogue, compiled and counted. The bar count is not a formula: it is the number of bar constraints the compiled mechanism actually carries, asked of the object rather than predicted. A line costs five bars and a quintic four hundred and thirteen, which is the field's central number — exactness is paid for in size. The all-revolute column replaces the one prismatic pair that closes the chain with a Peaucellier cell, which costs seven bars whatever the curve, so it is more than half the machine on a line and a rounding error on a quintic. The last column is the polynomial evaluated at the traced point, worst over each machine's working arc.
Fig. 6 The totals the arithmetic sits inside: a hundred bars of it in a machine of four hundred and thirteen.

What the arithmetic costs in total

Add it up for the largest machine in this field’s catalogue.

The quintic’s eighteen terms use frequencies up to five in each variable. Computing 11 through 55 of each by doubling and adding, sharing everything shareable, comes to twenty-four reflectors and a handful of means — call it a hundred bars including the rigid offsets that set each term’s phase and length.

The machine has four hundred and thirteen bars.

So the arithmetic is a quarter of the smallest useful machine and a quarter of the largest, and in between it is falling as a fraction. The growth rates are the reason: the arithmetic goes like the number of distinct multiples, which is 2d2d, times the bits in each, which is logd\log d. The transport goes like the square of the number of terms, which is d4d^4.

The algebra of a high-degree curve is not what makes its machine large. Nothing in this rung is a bottleneck. It is here because the absence of a bottleneck is the finding — the natural suspicion, that a construction producing four-hundred-bar machines must be doing something expensive with the arithmetic, is wrong, and knowing that it is wrong is what points at the transport.

A machine with no loops in its arithmetic

There is a structural fact hiding in the sharing that is worth surfacing, because it makes the arithmetic half of a compiled machine an unusually simple object.

The multiples form a tree. 2α2\alpha is built from α\alpha; 4α4\alpha from 2α2\alpha; 3α3\alpha from 2α2\alpha and α\alpha. Nothing is ever built from something that was built from it, because the numbers strictly decrease at every step of the recursion. So the arithmetic part of a compiled machine is a directed acyclic graph of gadgets, each determinate, each reading links that already exist.

That is why the whole thing can be placed joint by joint rather than solved as a system. Given the arm, every gadget’s output is fixed by parts already in place; given every term’s link, every chain vertex is fixed by the one before it. A compiled machine of two hundred and forty joints unwinds completely, and the only thing in it that has to be solved as a pair is the arm and the parallelogram that carries β\beta home.

The topology field has spent a phase on exactly this question — which subchains cannot be taken apart into dyads — and its smallest example is the four-bar, at four links. A compiled machine is a thousand times larger and structurally trivial, which is a pairing of adjectives worth keeping: size and structural depth are different axes, and this field’s machines are extreme on one and unremarkable on the other.

Two things the multiplier cannot do

It cannot multiply by a non-integer. Nothing in the doubling-and-adding scheme reaches α/2\alpha/2 or πα\pi\alpha. The mean gadget produces a half — it is a bisector, after all — but its output is a line rather than a link of known length, and the construction that turns a bisector into a usable input runs straight into the reflector’s singularity at exactly the wrong place. In any case the expansion only ever asks for integers, which is the whole reason the arm’s coordinates were written as Laurent polynomials: exponents add, and adding whole numbers gives whole numbers.

It cannot multiply an angle that is not a link at its own pivot. Every gadget in the chain reads links from one point, so a multiplier is built where its input is, and its output is a link from that same point. Moving the result anywhere is transport.

Both restrictions are consequences of the same fact and neither is a limitation of this particular construction. A bar states a distance; a rhombus states an angle relation between links sharing a vertex; and integer arithmetic on angles at a common pivot is the largest vocabulary those two sentences support.

Where an integer multiple already appears on this site

Angle multiplication by whole numbers is not new here, and the three places it has appeared are worth putting side by side, because they use three different mechanisms for the same relation and none of them can be swapped for another.

A gear pair multiplies an angle by the ratio of its tooth counts, which is a rational number and is exact — an integer count is the only thing in the subject that cannot drift. It is the cheapest angle multiplier there is, one pair of wheels, and it is unavailable here: a universality result for linkages that used gears would be answering a question nobody asked.

A planetary train multiplies by a ratio that is a difference of counts, and can reach a hundred to one from a difference of one. Also gears, also unavailable, and it is the standard example of a mechanism whose ratio is not the ratio of anything that can be pointed at.

A chain of rhombi multiplies by a whole number using nothing but bars and pins. It is far more expensive than either of the others per unit of multiplication and it is the only one made of the parts this construction is allowed.

The comparison is worth making because it locates what the constraint actually is. There is no difficulty multiplying an angle exactly; there is a difficulty doing it with lower pairs of one kind. Every awkwardness in this field traces back to a self-imposed restriction, and the restriction is what makes the result mean anything.

What a multiple looks like when it is running

A doubler is three bars and a rail, and watching one is the quickest way to see why the arithmetic is exact.

The readout on that figure is the departure — the output angle minus the closed form — and it stays at 101310^{-13} at every stop. Nothing about it is fitted. A rhombus has four equal sides at every position it can occupy, so the bisection is exact at every position, and the only error is the solver’s.

That the exactness survives chaining is the claim this rung actually makes, and it is checked at the level of the whole machine rather than gadget by gadget. The compiled machine for a quintic contains twenty-four reflectors in stacks up to five deep, and its tracing point satisfies the polynomial to 8.1×10138.1\times10^{-13}. Errors that compounded would show there.

The machine compiled from a cubic. x^3 − 0.2x − y, compiled: 101 bars and 69 joints, painted by what each part is for. The two-link arm at the pivot carries the tracing point; the reflectors and means build each term's angle; the rigid offsets fix the constant φₖ and the amplitude; the translators carry those directions out along the summing chain, whose last vertex is held on a line. That last constraint is the equation. Every joint drawn is the output of a Newton–Raphson solve on 134 equations, converged to 1.8e-15, and the polynomial at the tracing point is 3.1e-16.
Fig. 7 A machine with reflectors stacked five deep, whose tracing point sits on its curve at the solver’s floor.

The exactness is not fragile in the way chaining usually is

There is a general reason to distrust a stack of exact relations: exact relations composed numerically are not exact, and a chain five deep multiplying errors by anything would arrive somewhere useless.

That is not what happens, and the reason is worth naming. Every gadget’s relation is enforced by bar lengths, and the bar lengths do not change as the machine runs. A doubler’s rhombus has four sides of length ss at every configuration, so it bisects at every configuration; the fact that its input came from another doubler is invisible to it. Errors do not accumulate through the chain because nothing in the chain is computing anything — the whole assembly is solved at once, as one system of constraints, and the only error anywhere is the residual of that solve.

That is a different situation from a numerical pipeline, where each stage consumes the previous stage’s output and inherits its error. A linkage has no stages. It has one configuration, satisfying all its constraints simultaneously, and the depth of the notional computation is a fact about how the constraints were chosen rather than about how they are solved.

The measurement bears it out: five deep on the quintic, and the tracing point sits at 8.1×10138.1\times10^{-13}.

Where the number theory stops

One caution, since the binary expansion is a tempting thread to pull.

Finding the shortest addition chain for a number is a hard problem in general and it does not matter here, because the numbers are small. A curve of degree five needs multiples up to five and the binary route is optimal or within one gadget of optimal for every integer that small. A hypothetical curve of degree fifty would want more care, and a curve of degree fifty is a machine with something like six million bars, so the care would be misplaced.

The honest statement is that the arithmetic is not the constraint, at any degree anybody would compile, and that optimising it is optimising a quarter of a machine whose other three quarters grow twice as fast. The place to look for a smaller universality construction is the transport, and the reason nobody has made the transport cheap is that it is not a shortcoming of the method but a property of what a bar can say.

What this rung leaves for the next one

Every piece is now in hand. Two angles arrive from an arm. Integer multiples of each are built by doubling and adding, shared where they can be. Each term’s frequencies are combined by an addition, and one triangular link applies the phase angle and the length. The results are carried out along a chain and added head to tail, and the last vertex is held on a line.

The next rung assembles that, positions every joint by a converged solve, drives it, and asks the one question none of its constraints can answer: where is its tracing point, and is the polynomial zero there.

The answer is a number at the floor of double arithmetic, on every curve tried, over the whole of each machine’s working arc. What the phrase working arc is doing in that sentence is the subject of two rungs after it, and it is the honest half of the field.

The cost following the binary expansion rather than the size is the finding, and it has a design reading worth separating from the arithmetic. A designer choosing a multiple should choose one with few ones in it. Multiplying by eight costs three gadgets and multiplying by seven costs six, so a construction that can tolerate a factor of eight where it wanted seven has bought a halving for nothing. That is an unusual kind of design freedom — a discrete cost that is not monotone in the quantity — and it is the same shape as a reverted train’s non-monotone tooth counts and a compound epicyclic’s sparse reductions. In all three the useful instruction is the same: find out what latitude the requirement has before choosing the number, because the cost varies wildly between neighbours and the neighbours are usually acceptable.

What links here

Essays that link to this one from their own argument.

The objects this essay names

Each one links to every other essay that touches it.

Angle multiplierBinary expansionExact mechanismFrequency pairReflectionRhombusShared subexpression