Average Error: 0.0 → 0.0
Time: 20.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 r134355 = x;
        double r134356 = r134355 * r134355;
        double r134357 = y;
        double r134358 = r134357 * r134357;
        double r134359 = r134356 - r134358;
        return r134359;
}

double f(double x, double y) {
        double r134360 = x;
        double r134361 = y;
        double r134362 = r134360 - r134361;
        double r134363 = r134360 + r134361;
        double r134364 = r134362 * r134363;
        return r134364;
}

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