Average Error: 0.0 → 0.0
Time: 4.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 r98393 = x;
        double r98394 = r98393 * r98393;
        double r98395 = y;
        double r98396 = r98395 * r98395;
        double r98397 = r98394 - r98396;
        return r98397;
}

double f(double x, double y) {
        double r98398 = y;
        double r98399 = x;
        double r98400 = r98398 + r98399;
        double r98401 = r98399 - r98398;
        double r98402 = r98400 * r98401;
        return r98402;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\left(y + x\right)} \cdot \left(x - y\right)\]
  5. Final simplification0.0

    \[\leadsto \left(y + x\right) \cdot \left(x - y\right)\]

Reproduce

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