Average Error: 0.0 → 0.0
Time: 14.9s
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 r30033906 = x;
        double r30033907 = r30033906 * r30033906;
        double r30033908 = 2.0;
        double r30033909 = r30033906 * r30033908;
        double r30033910 = y;
        double r30033911 = r30033909 * r30033910;
        double r30033912 = r30033907 + r30033911;
        double r30033913 = r30033910 * r30033910;
        double r30033914 = r30033912 + r30033913;
        return r30033914;
}

double f(double x, double y) {
        double r30033915 = y;
        double r30033916 = r30033915 * r30033915;
        double r30033917 = x;
        double r30033918 = 2.0;
        double r30033919 = r30033918 * r30033915;
        double r30033920 = r30033917 + r30033919;
        double r30033921 = r30033917 * r30033920;
        double r30033922 = r30033916 + r30033921;
        return r30033922;
}

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

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

Reproduce

herbie shell --seed 2019192 
(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)))