Average Error: 0.0 → 0.0
Time: 5.0s
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 r122689 = x;
        double r122690 = r122689 * r122689;
        double r122691 = y;
        double r122692 = r122691 * r122691;
        double r122693 = r122690 - r122692;
        return r122693;
}

double f(double x, double y) {
        double r122694 = y;
        double r122695 = x;
        double r122696 = r122694 + r122695;
        double r122697 = r122695 - r122694;
        double r122698 = r122696 * r122697;
        return r122698;
}

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(y + x\right) \cdot \left(x - y\right)}\]
  3. Final simplification0.0

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

Reproduce

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