Average Error: 0.0 → 0.0
Time: 9.7s
Precision: 64
\[\left(x + y\right) \cdot \left(x - y\right)\]
\[{x}^{2} - {y}^{2}\]
\left(x + y\right) \cdot \left(x - y\right)
{x}^{2} - {y}^{2}
double f(double x, double y) {
        double r110508 = x;
        double r110509 = y;
        double r110510 = r110508 + r110509;
        double r110511 = r110508 - r110509;
        double r110512 = r110510 * r110511;
        return r110512;
}

double f(double x, double y) {
        double r110513 = x;
        double r110514 = 2.0;
        double r110515 = pow(r110513, r110514);
        double r110516 = y;
        double r110517 = pow(r110516, r110514);
        double r110518 = r110515 - r110517;
        return r110518;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) \cdot \left(x - y\right)\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto \color{blue}{\left(1 \cdot \left(x + y\right)\right)} \cdot \left(x - y\right)\]
  4. Applied associate-*l*0.0

    \[\leadsto \color{blue}{1 \cdot \left(\left(x + y\right) \cdot \left(x - y\right)\right)}\]
  5. Simplified0.0

    \[\leadsto 1 \cdot \color{blue}{\left({x}^{2} - {y}^{2}\right)}\]
  6. Final simplification0.0

    \[\leadsto {x}^{2} - {y}^{2}\]

Reproduce

herbie shell --seed 2019323 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f1 from sbv-4.4"
  :precision binary64
  (* (+ x y) (- x y)))