Average Error: 0.0 → 0.0
Time: 14.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 r95770 = x;
        double r95771 = r95770 * r95770;
        double r95772 = y;
        double r95773 = r95772 * r95772;
        double r95774 = r95771 - r95773;
        return r95774;
}

double f(double x, double y) {
        double r95775 = x;
        double r95776 = y;
        double r95777 = r95775 - r95776;
        double r95778 = r95775 + r95776;
        double r95779 = r95777 * r95778;
        return r95779;
}

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