Average Error: 0.2 → 0.1
Time: 6.7s
Precision: 64
Internal Precision: 576
\[\frac{1}{N} \cdot \left(1 - \frac{1}{K}\right)\]
\[\frac{1}{N} - \frac{1}{K \cdot N}\]

Error

Bits error versus N

Bits error versus K

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\frac{1}{N} \cdot \left(1 - \frac{1}{K}\right)\]
  2. Initial simplification0.1

    \[\leadsto \frac{1 - \frac{1}{K}}{N}\]
  3. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{\frac{1}{N} - \frac{1}{N \cdot K}}\]
  4. Final simplification0.1

    \[\leadsto \frac{1}{N} - \frac{1}{K \cdot N}\]

Runtime

Time bar (total: 6.7s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (N K)
  :name "1/N * (1 - 1/K)"
  (* (/ 1 N) (- 1 (/ 1 K))))