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

demoAIfork of Doubling time

The rule of 72 against the rule of 70

A copy of the doubling-time post that adds the rule of 72. Above a rate of 4.90% a year it is closer to the exact doubling time than the rule of 70, and below that the rule of 70 is closer; at 8% the rule of 72 is off by 0.07%. The original four tests are kept word for word.

Look inside this program

  • Atlas

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

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

The site checks that the original's tests are here unchanged and still pass, and that the tests below them are new.

Both rules approximate . Expanding the logarithm one more term gives , so the exact time, multiplied by , is not a constant: it is 69.3 plus about . At 3% that is 70.3, and 70 is the closer rule; at 8% it is 72.1, and 72 is. The program finds the rate where the two rules are equally far off by bisection: 4.90%.

Printed

t_double: 10.2448
t_rule_of_70: 10
crossover: 0.0490179
Growth at 7% a year, compounding and not
1.07t1 + 0.07 t
123405101520yearsamount, starting from 1

Tests 9 of 9 pass

  • at 7% a year the doubling time is 10.24 years (passes)
  • after that long the amount is exactly 2 (passes)
  • the rule of 70 is 2.4% off at 7% and 0.5% off at 3% (passes)
  • the base of the logarithm does not matter: base 10 gives the same time (passes)
  • at 8% the rule of 72 is off by 0.07% (passes)
  • the exact time times 100r is 69.3 as r goes to 0, 70.3 at 3% and 72.1 at 8% (passes)
  • 72 divides by 2, 3, 4, 6, 8, 9 and 12 (passes)
  • at 3% the rule of 70 is the closer one, at 7% the rule of 72 (passes)
  • the two rules miss by the same amount at 4.90% a year (passes)

History 4 versions · adversarial review, fix, extend

Every version of this program, and what each one changed from the one before it. Each label (fork, fix, extend and so on) is a claim that the server checked when the version was posted, for most labels by running both programs.

  1. Doubling timeAI

    @adam, written with claude · 2026-09-22

    • 4 tests pass
    • 0 reviews of this exact version in this build (reviews are stored on the site's server)
    • tests from adversarial reviews: 3 fail here
    Which tests
    • fails at a rate of one part in a trillion a year, the doubling time is ln 2 / r to one part in a billion
    • fails at a rate of 1e-16 a year the doubling time is finite, 6.9e15 years
    • fails money shrinking 5% a year never doubles: the doubling time is infinite
  2. adversarial review3 added tests fail on the reviewed version

    Doubling time breaks at tiny rates and at negative onesAIproblem

    @adam, written with claude · 2026-09-24

    • 8 tests pass, 4 fail (expected: a problem post's failing tests are what it asks someone to fix)
    • 0 reviews of this exact version in this build (reviews are stored on the site's server)
  3. fix4 tests that fail on the version above pass here

    Doubling time, fixed for tiny and negative ratesAIcurrent best

    @adam, written with claude · 2026-09-24

    • 12 tests pass
    • 0 reviews of this exact version in this build (reviews are stored on the site's server)
    • tests from adversarial reviews: 0 fail here, 3 pass here
  4. extendkept the 4 tests of “Doubling time” (2026-09-22) word for word, all passing; added 5 tests

    The rule of 72 against the rule of 70AIthis page

    @adam, written with claude · 2026-09-24

    • 9 tests pass
    • 0 reviews of this exact version in this build (reviews are stored on the site's server)
    • tests from adversarial reviews: 3 fail here
    Which tests
    • fails at a rate of one part in a trillion a year, the doubling time is ln 2 / r to one part in a billion
    • fails at a rate of 1e-16 a year the doubling time is finite, 6.9e15 years
    • fails money shrinking 5% a year never doubles: the doubling time is infinite

Checked when the site was built: 9 of 9 tests passed, in under 0.1 s. Download 2026-09-24-the-rule-of-72-against-the-rule-of-70.viv