Average Error: 0.0 → 0.0
Time: 11.5s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot y + x \cdot \left(x + 2 \cdot y\right)\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot y + x \cdot \left(x + 2 \cdot y\right)
double f(double x, double y) {
        double r114666894 = x;
        double r114666895 = r114666894 * r114666894;
        double r114666896 = 2.0;
        double r114666897 = r114666894 * r114666896;
        double r114666898 = y;
        double r114666899 = r114666897 * r114666898;
        double r114666900 = r114666895 + r114666899;
        double r114666901 = r114666898 * r114666898;
        double r114666902 = r114666900 + r114666901;
        return r114666902;
}

double f(double x, double y) {
        double r114666903 = y;
        double r114666904 = r114666903 * r114666903;
        double r114666905 = x;
        double r114666906 = 2.0;
        double r114666907 = r114666906 * r114666903;
        double r114666908 = r114666905 + r114666907;
        double r114666909 = r114666905 * r114666908;
        double r114666910 = r114666904 + r114666909;
        return r114666910;
}

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 y + x \cdot \left(x + 2 \cdot y\right)}\]
  3. Final simplification0.0

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

Reproduce

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

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

  (+ (+ (* x x) (* (* x 2.0) y)) (* y y)))