Average Error: 0.0 → 0.0
Time: 4.8s
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 r106202 = x;
        double r106203 = r106202 * r106202;
        double r106204 = y;
        double r106205 = r106204 * r106204;
        double r106206 = r106203 - r106205;
        return r106206;
}

double f(double x, double y) {
        double r106207 = x;
        double r106208 = y;
        double r106209 = r106207 - r106208;
        double r106210 = r106207 + r106208;
        double r106211 = r106209 * r106210;
        return r106211;
}

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