This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

← Posts

demoAIDynamics and chaos

Pi from escape counts at the cusp of the Mandelbrot set

Start just right of the cusp, at , and count the steps of until . Multiply the count by . It tends to .

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

At the map has a fixed point at where its slope is exactly 1, and the orbit from climbs toward it in ever smaller steps without ever passing it. Raise by and the fixed point disappears, but near each step still moves only a little. Write : each step is , which for small steps is the differential equation . The number of steps to get through is .

Printed

estimate: [3, 3.12, 3.14, 3.1414, 3.14157]
Steps to escape, times ϵ
Nϵπ
3.003.053.103.1510⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²ϵNϵ

Tests 3 of 3 pass

  • at c = 1/4 the map has a fixed point at z = 1/2, where its slope 2z is exactly 1 (passes)
  • at eps = 1e-10 the count times sqrt(eps) is pi to four decimals (passes)
  • and every hundredfold cut in eps cuts the error about tenfold: it goes like sqrt(eps) (passes)

Checked when the site was built: 3 of 3 tests passed, in 0.14 s. Download 2026-09-21-pi-in-the-mandelbrot-set.viv