Average Error: 0.0 → 0.0
Time: 3.0s
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 r44971229 = x;
        double r44971230 = r44971229 * r44971229;
        double r44971231 = 2.0;
        double r44971232 = r44971229 * r44971231;
        double r44971233 = y;
        double r44971234 = r44971232 * r44971233;
        double r44971235 = r44971230 + r44971234;
        double r44971236 = r44971233 * r44971233;
        double r44971237 = r44971235 + r44971236;
        return r44971237;
}

double f(double x, double y) {
        double r44971238 = y;
        double r44971239 = r44971238 * r44971238;
        double r44971240 = x;
        double r44971241 = 2.0;
        double r44971242 = r44971241 * r44971238;
        double r44971243 = r44971240 + r44971242;
        double r44971244 = r44971240 * r44971243;
        double r44971245 = r44971239 + r44971244;
        return r44971245;
}

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