Average Error: 0.0 → 0.0
Time: 1.1s
Precision: 64
\[x \cdot x - y \cdot y\]
\[\left(x + y\right) \cdot \left(x - y\right)\]
x \cdot x - y \cdot y
\left(x + y\right) \cdot \left(x - y\right)
double f(double x, double y) {
        double r192257 = x;
        double r192258 = r192257 * r192257;
        double r192259 = y;
        double r192260 = r192259 * r192259;
        double r192261 = r192258 - r192260;
        return r192261;
}

double f(double x, double y) {
        double r192262 = x;
        double r192263 = y;
        double r192264 = r192262 + r192263;
        double r192265 = r192262 - r192263;
        double r192266 = r192264 * r192265;
        return r192266;
}

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(x + y\right) \cdot \left(x - y\right)\]

Reproduce

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