Average Error: 0.0 → 0.0
Time: 5.4s
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 r105230 = x;
        double r105231 = r105230 * r105230;
        double r105232 = y;
        double r105233 = r105232 * r105232;
        double r105234 = r105231 - r105233;
        return r105234;
}

double f(double x, double y) {
        double r105235 = y;
        double r105236 = x;
        double r105237 = r105235 + r105236;
        double r105238 = r105236 - r105235;
        double r105239 = r105237 * r105238;
        return r105239;
}

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