Average Error: 0.0 → 0.0
Time: 10.0s
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 r141818 = x;
        double r141819 = r141818 * r141818;
        double r141820 = y;
        double r141821 = r141820 * r141820;
        double r141822 = r141819 - r141821;
        return r141822;
}

double f(double x, double y) {
        double r141823 = y;
        double r141824 = x;
        double r141825 = r141823 + r141824;
        double r141826 = r141824 - r141823;
        double r141827 = r141825 * r141826;
        return r141827;
}

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