Average Error: 0.0 → 0.0
Time: 6.9s
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 r137440 = x;
        double r137441 = r137440 * r137440;
        double r137442 = y;
        double r137443 = r137442 * r137442;
        double r137444 = r137441 - r137443;
        return r137444;
}

double f(double x, double y) {
        double r137445 = y;
        double r137446 = x;
        double r137447 = r137445 + r137446;
        double r137448 = r137446 - r137445;
        double r137449 = r137447 * r137448;
        return r137449;
}

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