Average Error: 0.0 → 0.0
Time: 2.0s
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 r688898 = x;
        double r688899 = r688898 * r688898;
        double r688900 = 2.0;
        double r688901 = r688898 * r688900;
        double r688902 = y;
        double r688903 = r688901 * r688902;
        double r688904 = r688899 + r688903;
        double r688905 = r688902 * r688902;
        double r688906 = r688904 + r688905;
        return r688906;
}

double f(double x, double y) {
        double r688907 = y;
        double r688908 = x;
        double r688909 = 2.0;
        double r688910 = r688908 * r688909;
        double r688911 = r688910 + r688907;
        double r688912 = r688907 * r688911;
        double r688913 = r688908 * r688908;
        double r688914 = r688912 + r688913;
        return r688914;
}

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 2020003 
(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)))