Average Error: 0.0 → 0.0
Time: 6.6s
Precision: 64
\[x \cdot x - y \cdot y\]
\[\left(y + x\right) \cdot \left(x - y\right)\]
x \cdot x - y \cdot y
\left(y + x\right) \cdot \left(x - y\right)
double f(double x, double y) {
        double r8991558 = x;
        double r8991559 = r8991558 * r8991558;
        double r8991560 = y;
        double r8991561 = r8991560 * r8991560;
        double r8991562 = r8991559 - r8991561;
        return r8991562;
}

double f(double x, double y) {
        double r8991563 = y;
        double r8991564 = x;
        double r8991565 = r8991563 + r8991564;
        double r8991566 = r8991564 - r8991563;
        double r8991567 = r8991565 * r8991566;
        return r8991567;
}

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

    \[x \cdot x - y \cdot y\]
  2. Using strategy rm
  3. Applied difference-of-squares0.0

    \[\leadsto \color{blue}{\left(x + y\right) \cdot \left(x - y\right)}\]
  4. Final simplification0.0

    \[\leadsto \left(y + x\right) \cdot \left(x - y\right)\]

Reproduce

herbie shell --seed 2019169 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f2 from sbv-4.4"
  (- (* x x) (* y y)))