Average Error: 0.0 → 0.0
Time: 6.3s
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 r9336382 = x;
        double r9336383 = r9336382 * r9336382;
        double r9336384 = y;
        double r9336385 = r9336384 * r9336384;
        double r9336386 = r9336383 - r9336385;
        return r9336386;
}

double f(double x, double y) {
        double r9336387 = y;
        double r9336388 = x;
        double r9336389 = r9336387 + r9336388;
        double r9336390 = r9336388 - r9336387;
        double r9336391 = r9336389 * r9336390;
        return r9336391;
}

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 2019162 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f2 from sbv-4.4"
  (- (* x x) (* y y)))