Average Error: 0.0 → 0.0
Time: 7.5s
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 r10389228 = x;
        double r10389229 = r10389228 * r10389228;
        double r10389230 = y;
        double r10389231 = r10389230 * r10389230;
        double r10389232 = r10389229 - r10389231;
        return r10389232;
}

double f(double x, double y) {
        double r10389233 = y;
        double r10389234 = x;
        double r10389235 = r10389233 + r10389234;
        double r10389236 = r10389234 - r10389233;
        double r10389237 = r10389235 * r10389236;
        return r10389237;
}

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