Average Error: 29.6 → 0
Time: 10.6s
Precision: 64
\[\frac{{a}^{2} - {b}^{2}}{a + b}\]
\[a - b\]
\frac{{a}^{2} - {b}^{2}}{a + b}
a - b
double f(double a, double b) {
        double r24399615 = a;
        double r24399616 = 2.0;
        double r24399617 = pow(r24399615, r24399616);
        double r24399618 = b;
        double r24399619 = pow(r24399618, r24399616);
        double r24399620 = r24399617 - r24399619;
        double r24399621 = r24399615 + r24399618;
        double r24399622 = r24399620 / r24399621;
        return r24399622;
}

double f(double a, double b) {
        double r24399623 = a;
        double r24399624 = b;
        double r24399625 = r24399623 - r24399624;
        return r24399625;
}

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 29.6

    \[\frac{{a}^{2} - {b}^{2}}{a + b}\]
  2. Simplified0

    \[\leadsto \color{blue}{a - b}\]
  3. Final simplification0

    \[\leadsto a - b\]

Reproduce

herbie shell --seed 1 
(FPCore (a b)
  :name "(pow(a,2)-pow(b,2))/(a+b)"
  (/ (- (pow a 2) (pow b 2)) (+ a b)))