Research shelf / Software & languages / Babbage · Antikythera · TDC
Written Updated
Three mechanical computers, re-derived as modern algorithms
Mechanical computers were designed under constraints that modern software has quietly rediscovered: no random access, no allocation, no division, and a hard limit on how much state you can hold. The papers here take that seriously enough to benchmark it — and find that the nineteenth-century memory pattern is the cache-friendly one.
Experiments were run and the numbers are reported here.
Babbage’s difference engine, the Antikythera mechanism’s epicyclic gearing, and the WWII Torpedo Data Computer — each reconstructed as a benchmarked algorithm rather than a museum piece.
Babbage’s method of finite differences is rebuilt as a family of algorithms from a cascade reference implementation up to a loop-unrolled variant, using only integer addition. The finding is not nostalgic: the cascaded, addition-only, in-place pattern that a gear train forces on you is exactly the cache-friendly access pattern, and it beats naive implementations through reduced allocation and better locality. The binomial-coefficient structure underlying all difference orders lets coefficients be generated with no table at all.
The Military-Grade Antikythera Algorithm extracts three engines from a 2,100-year-old bronze calculator: epicyclic interpolation via Fourier-mode reconstruction, prime-factor optimisation via continued fractions, and nested circular processing for multi-frequency decomposition. The original device encoded astronomical periods as rational fractions using the prime factors 7, 17, 19, 53, 127 and 223 — chosen to hit celestial cycles with the fewest gear teeth, which is the same problem as rational approximation under a cost budget.
The Torpedo Data Computer paper reimplements the US Navy’s 1932 fire-control system — the first continuous, real-time, submarine-based integrated fire-control computer. The Position Keeper digitally simulates wheel-and-disc mechanical integration including momentum and friction coefficients, preserving the temporal smoothing the analogue mechanism provided, rather than replacing it with an idealised integrator.
Every number, and what stands behind it
A claim is only worth the evidence attached to it. Each row below carries its basis: measured on the author’s own hardware, derived from the construction, measured on synthetic data, projected from literature, or simply cited.
| Claim | Figure | Basis | Context |
|---|---|---|---|
| Difference-engine speedup | 3–6× over naive | Measured | Profiled across 32–2048 points |
| Difference-engine memory reduction | 50–80% | Measured | In-place cascade vs naive allocation |
| Antikythera engine speedup | 386× over naive Python | Measured | 5,000-point datasets, fully optimised path |
| Antikythera prime factors | [7, 17, 19, 53, 127, 223] | Cited | From the mechanism itself — Nature, 2006 |
| TDC solution rate | >1,000,000 solutions/sec | Measured | Digital reimplementation |
| TDC accuracy | ±0.015° | Measured | 10× better than the legacy Mark 117 reference |
| TDC memory over 24 h | 5.3 MB bounded | Measured | Continuous operation |
| Gyro-angle envelope | ±80° → ±180° | Derived | Extension of the original mechanical limit |
Measured — author-run experiment on the stated setup. Synthetic — measured, but on synthetic rather than real data. Derived — follows from the stated construction or proof. Projected — paper-stated projection, not an author-run benchmark. Cited — taken from external literature.
How it works
- Cascaded addition-only differencing. No multiplication, no division, in-place — the constraint the gear train imposed, which turns out to be the locality-friendly one.
- Continued-fraction rational approximation. The Antikythera’s gear-tooth minimisation problem, solved the way the ancients solved it.
- Fourier-mode epicyclic reconstruction. Vectorised trigonometry replacing the epicyclic gear train, for signal interpolation.
- Wheel-and-disc integrator simulation. Momentum and friction modelled explicitly so the digital Position Keeper keeps the analogue smoothing behaviour.
What it does not do
Taken from the folder’s own README. Nothing here has been softened.
- All speedups are against naive implementations in the same language, not against optimised library baselines (BLAS, FFTW, or a tuned C polynomial evaluator).
- 386× over naive Python is largely a statement about naive Python.
- The TDC accuracy comparison is against a historical system, on the author’s reimplementation of both sides.
- The FPGA implementations are described as conceptual; no synthesis results or timing closure.
- Fire-control and ballistic content is a historical reconstruction exercise, not an operational system.
Free under AGPL-3.0+ for almost everyone
Personal use, charities, education and organisations under AUD 50,000 a year pay nothing. A tiered commercial licence covers everyone else.