Average Error: 0.0 → 0.0
Time: 15.1s
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 r19929 = x;
        double r19930 = r19929 * r19929;
        double r19931 = y;
        double r19932 = r19931 * r19931;
        double r19933 = r19930 - r19932;
        return r19933;
}

double f(double x, double y) {
        double r19934 = x;
        double r19935 = y;
        double r19936 = r19934 - r19935;
        double r19937 = r19934 + r19935;
        double r19938 = r19936 * r19937;
        return r19938;
}

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