Average Error: 0.0 → 0.0
Time: 3.7s
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 r151170 = x;
        double r151171 = r151170 * r151170;
        double r151172 = y;
        double r151173 = r151172 * r151172;
        double r151174 = r151171 - r151173;
        return r151174;
}

double f(double x, double y) {
        double r151175 = y;
        double r151176 = x;
        double r151177 = r151175 + r151176;
        double r151178 = r151176 - r151175;
        double r151179 = r151177 * r151178;
        return r151179;
}

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. Using strategy rm
  3. Applied difference-of-squares0.0

    \[\leadsto \color{blue}{\left(x + y\right) \cdot \left(x - y\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\left(y + x\right)} \cdot \left(x - y\right)\]
  5. Final simplification0.0

    \[\leadsto \left(y + x\right) \cdot \left(x - y\right)\]

Reproduce

herbie shell --seed 2019297 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f2 from sbv-4.4"
  :precision binary64
  (- (* x x) (* y y)))