Average Error: 0.0 → 0.0
Time: 3.5s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot \left(x \cdot 2 + y\right) + x \cdot x\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot \left(x \cdot 2 + y\right) + x \cdot x
double f(double x, double y) {
        double r583558 = x;
        double r583559 = r583558 * r583558;
        double r583560 = 2.0;
        double r583561 = r583558 * r583560;
        double r583562 = y;
        double r583563 = r583561 * r583562;
        double r583564 = r583559 + r583563;
        double r583565 = r583562 * r583562;
        double r583566 = r583564 + r583565;
        return r583566;
}

double f(double x, double y) {
        double r583567 = y;
        double r583568 = x;
        double r583569 = 2.0;
        double r583570 = r583568 * r583569;
        double r583571 = r583570 + r583567;
        double r583572 = r583567 * r583571;
        double r583573 = r583568 * r583568;
        double r583574 = r583572 + r583573;
        return r583574;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[x \cdot x + \left(y \cdot y + \left(x \cdot y\right) \cdot 2\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020027 
(FPCore (x y)
  :name "Examples.Basics.ProofTests:f4 from sbv-4.4"
  :precision binary64

  :herbie-target
  (+ (* x x) (+ (* y y) (* (* x y) 2)))

  (+ (+ (* x x) (* (* x 2) y)) (* y y)))