Average Error: 0.0 → 0.0
Time: 14.4s
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 r136813 = x;
        double r136814 = r136813 * r136813;
        double r136815 = y;
        double r136816 = r136815 * r136815;
        double r136817 = r136814 - r136816;
        return r136817;
}

double f(double x, double y) {
        double r136818 = x;
        double r136819 = y;
        double r136820 = r136818 - r136819;
        double r136821 = r136818 + r136819;
        double r136822 = r136820 * r136821;
        return r136822;
}

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