Average Error: 0.0 → 0.0
Time: 44.9s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(x + y \cdot 2\right) \cdot x + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(x + y \cdot 2\right) \cdot x + y \cdot y
double f(double x, double y) {
        double r27704165 = x;
        double r27704166 = r27704165 * r27704165;
        double r27704167 = 2.0;
        double r27704168 = r27704165 * r27704167;
        double r27704169 = y;
        double r27704170 = r27704168 * r27704169;
        double r27704171 = r27704166 + r27704170;
        double r27704172 = r27704169 * r27704169;
        double r27704173 = r27704171 + r27704172;
        return r27704173;
}

double f(double x, double y) {
        double r27704174 = x;
        double r27704175 = y;
        double r27704176 = 2.0;
        double r27704177 = r27704175 * r27704176;
        double r27704178 = r27704174 + r27704177;
        double r27704179 = r27704178 * r27704174;
        double r27704180 = r27704175 * r27704175;
        double r27704181 = r27704179 + r27704180;
        return r27704181;
}

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

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

Reproduce

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