Average Error: 0.0 → 0.0
Time: 10.3s
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 r138952 = x;
        double r138953 = r138952 * r138952;
        double r138954 = y;
        double r138955 = r138954 * r138954;
        double r138956 = r138953 - r138955;
        return r138956;
}

double f(double x, double y) {
        double r138957 = y;
        double r138958 = x;
        double r138959 = r138957 + r138958;
        double r138960 = r138958 - r138957;
        double r138961 = r138959 * r138960;
        return r138961;
}

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