A dart thrown into the dark landed on the trick that put sine and cosine inside pocket calculators and flight computers with no multiplier at all — rotate a vector by ever-smaller angles, each a single bit shift, until it points where you asked. We show the technique, credit who actually made it, and ask what I-13 should learn. Three prongs, one dart.
THE TECHNIQUE rotate · halve the angle · converge
Start with the vector (K, 0) and your target angle z. At step i you can only rotate by ±atan(2−i) — a rotation whose tangent is exactly a power of two, so the rotation is just a shift. Turn toward z each time (sign of the leftover angle), and the vector spirals onto (cos z, sin z). The pre-scale K ≈ 0.607253 cancels the gain the shifts add. live demo
x' = x − d·(y >> i) // d = +1 if z>0 else −1
y' = y + d·(x >> i) // >> i is × 2^−i, done as a shift
z' = z − d·atan(2^−i) // subtract the angle we just spent
// after N steps: x ≈ cos(target), y ≈ sin(target)
CORDIC gets loosely waved at “the calculator people” or “HP” — but it began in avionics, one named engineer, years before a calculator carried it. cited
1956 · Jack E. Volder, at Convair’s aeroelectronics dept, conceives CORDIC — COordinate Rotation DIgital Computer — to replace the B-58 bomber’s analog navigation resolver. 1959 · Volder publishes “The CORDIC Trigonometric Computing Technique” in IRE Transactions on Electronic Computers. He is the inventor. 1971 · John Stephen Walther (Hewlett-Packard) generalizes it into Unified CORDIC — one iteration shape now also yields hyperbolic functions, exp, ln and square roots — the form that went into the HP-35, the first scientific pocket calculator.
The deep prior art: the shift-and-add idea for logarithms traces to Henry Briggs, 1624 — cited in 1968 to defeat a Wang Laboratories patent claim. So Volder invented the rotation algorithm; the arithmetic lineage is three centuries older. disputed / prior-art
RECOMMEND FOR I-13 what the galaxy should learn
CORDIC’s whole elegance is trading a multiply for a shift — x >> i instead of x × 2−i. That is the one move I-13 cannot make. It has the expensive op (BinOp *) but not the cheap one (no shift, no bitwise). I asked the real compiler — proven, not asserted:
$ i13 run mul.i13 RUN OK · a <- 8 ; b <- a * 2 → b = 16 (I-13 HAS multiply)
$ i13 check shift.i13 shift.i13:2:11 E0102 expected expression (a >> 1 — there is no >> operator)
So a faithful CORDIC in I-13 would have to multiply by 2−i — correct, but it throws away the exact thing that made CORDIC worth inventing. The lack is one operator, not a missing type.
Recommend: add shift as BinOp discriminants (>>, <<) alongside the existing + − * / — spending zero new alphabet symbols (`BinOp` is already one of THE TWELVE; a new discriminant is free). That alone lets I-13 express the shift-and-add family and reinforces the bit-ops theme other darts keep hitting. The irony worth naming: I-13 shipped the costly arithmetic op and skipped the cheap one. On real hardware a shift is a wire; a multiply is a datapath. A counted alphabet ranks by how often source uses a symbol, not by what it costs to run — and multiply is written far more often than shift, so the census kept the pricier op. Tradeoff (honest): I-13’s identity is a counted 13-symbol alphabet and an f64-only `Constant`. Shifts assume an integer bit view; on pure f64 you would define them as multiply/divide by 2i with a floor — which recovers CORDIC’s form but not its hardware win. Worth it only if bit-level work is in scope for the galaxy.