Average Error: 0.0 → 0.0
Time: 12.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 r5843565 = x;
        double r5843566 = r5843565 * r5843565;
        double r5843567 = y;
        double r5843568 = r5843567 * r5843567;
        double r5843569 = r5843566 - r5843568;
        return r5843569;
}

double f(double x, double y) {
        double r5843570 = y;
        double r5843571 = x;
        double r5843572 = r5843570 + r5843571;
        double r5843573 = r5843571 - r5843570;
        double r5843574 = r5843572 * r5843573;
        return r5843574;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f2 from sbv-4.4"
  (- (* x x) (* y y)))