Average Error: 0.0 → 0.0
Time: 6.5s
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 r197976 = x;
        double r197977 = r197976 * r197976;
        double r197978 = y;
        double r197979 = r197978 * r197978;
        double r197980 = r197977 - r197979;
        return r197980;
}

double f(double x, double y) {
        double r197981 = x;
        double r197982 = y;
        double r197983 = r197981 - r197982;
        double r197984 = r197981 + r197982;
        double r197985 = r197983 * r197984;
        return r197985;
}

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