Average Error: 0.0 → 0.0
Time: 10.9s
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 r127925 = x;
        double r127926 = r127925 * r127925;
        double r127927 = y;
        double r127928 = r127927 * r127927;
        double r127929 = r127926 - r127928;
        return r127929;
}

double f(double x, double y) {
        double r127930 = y;
        double r127931 = x;
        double r127932 = r127930 + r127931;
        double r127933 = r127931 - r127930;
        double r127934 = r127932 * r127933;
        return r127934;
}

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