Average Error: 0.0 → 0.0
Time: 15.3s
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 r156432 = x;
        double r156433 = r156432 * r156432;
        double r156434 = y;
        double r156435 = r156434 * r156434;
        double r156436 = r156433 - r156435;
        return r156436;
}

double f(double x, double y) {
        double r156437 = x;
        double r156438 = y;
        double r156439 = r156437 - r156438;
        double r156440 = r156437 + r156438;
        double r156441 = r156439 * r156440;
        return r156441;
}

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

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

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

Reproduce

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