Average Error: 0.0 → 0.0
Time: 6.4s
Precision: 64
\[\frac{a - b}{n}\]
\[\frac{a}{n} - \frac{b}{n}\]
\frac{a - b}{n}
\frac{a}{n} - \frac{b}{n}
double f(double a, double b, double n) {
        double r137402 = a;
        double r137403 = b;
        double r137404 = r137402 - r137403;
        double r137405 = n;
        double r137406 = r137404 / r137405;
        return r137406;
}

double f(double a, double b, double n) {
        double r137407 = a;
        double r137408 = n;
        double r137409 = r137407 / r137408;
        double r137410 = b;
        double r137411 = r137410 / r137408;
        double r137412 = r137409 - r137411;
        return r137412;
}

Error

Bits error versus a

Bits error versus b

Bits error versus n

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{a - b}{n}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{a}{n} - \frac{b}{n}}\]
  4. Final simplification0.0

    \[\leadsto \frac{a}{n} - \frac{b}{n}\]

Reproduce

herbie shell --seed 1 
(FPCore (a b n)
  :name "(a - b) / n"
  :precision binary64
  (/ (- a b) n))