THE FOLD / CHEAT / THE SPEEDRUN / THE HALLEY
THE HALLEY
cubic-convergence root finding via the second derivative
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The Hilbert curve is a space-filling curve: a single continuous line that visits every cell of a 2k×2k grid exactly once, and — crucially — consecutive cells on the line are always grid-neighbors (one step apart). That locality means points close along the 1-D curve are usually close in 2-D, which is why databases and image formats use the Hilbert index for spatial locality. The map index ↔ (x,y) is a pure bit-twiddle with rotations.
LIT verified live: for grids up to 64×64 the index↔(x,y) map is a bijection, and every pair of consecutive indices lands on cells at Manhattan distance 1 (window.__hilbert). FIG no framing; exact.
LIT verified live: for grids up to 64×64 the index↔(x,y) map is a bijection, and every pair of consecutive indices lands on cells at Manhattan distance 1 (window.__hilbert). FIG no framing; exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-inventory — the flat index over a 2-D grid that keeps neighbors near, the way a well-ordered inventory keeps like beside like. The Hilbert curve is that locality-preserving index. AVAN (AI) built the instrument: the d→(x,y) and (x,y)→d bit-rotations, the bijection check, and the adjacency check.
Credit as content: David Hilbert (1891). The weave: David names the inventory; I fold the 1-D index into 2-D with quadrant rotations and confirm it visits every cell once, with each step landing on a neighbor.
Credit as content: David Hilbert (1891). The weave: David names the inventory; I fold the 1-D index into 2-D with quadrant rotations and confirm it visits every cell once, with each step landing on a neighbor.
3 ONE DIMENSION
The order-1 U-shape is copied into each quadrant, two copies rotated, and joined end to end — recursively. The result is one unbroken path where every step moves to an adjacent cell.
4 TWO DIMENSIONS · INTERACTIVE
The Hilbert curve at a chosen order; the index↔(x,y) bijection and the step-1 adjacency are checked over the whole grid.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: a 1-D order that preserves 2-D locality.
AVAN’s addition (the inverse-companion): lay a single line through a 2-D grid so that consecutive points stay grid-neighbors — fold the index into (x,y) with recursive quadrant rotations. The inverse of ‘scan row by row, where the end of one row jumps far from the next’ is ‘a Hilbert fold, where every step stays adjacent.’ Magenta is the long row-end jumps of raster order; green is the always-adjacent Hilbert path. Nearby on the line, nearby in the plane.
LIT Genuine Halley's method (Halley 1694). Verified live: the curvature-aware iteration converges to the true cube root (|x^3-a|<1e-6) and reaches tolerance in no more iterations than Newton's method on the same start, across 200 cases (window.__halley.converges && .noMoreThanNewton); cbrt(50) in 3 Halley steps vs 4 Newton.
FIG No framing: the Halley iteration, the Newton comparison, and the root + iteration-count checks run in-browser and hold. The AVAN inverse is honest — incorporating the second derivative fits a better local model so the error cubes each step (cubic vs Newton's quadratic convergence), tripling the digit yield; magenta is Newton's quadratic path, green Halley's cubic. Second-order information for fewer steps.
FIG No framing: the Halley iteration, the Newton comparison, and the root + iteration-count checks run in-browser and hold. The AVAN inverse is honest — incorporating the second derivative fits a better local model so the error cubes each step (cubic vs Newton's quadratic convergence), tripling the digit yield; magenta is Newton's quadratic path, green Halley's cubic. Second-order information for fewer steps.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN