Average Error: 0.0 → 0.0
Time: 5.4s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left(\left(y \cdot x + y \cdot x\right) + y \cdot y\right) + x \cdot x\]
\left(x + y\right) \cdot \left(x + y\right)
\left(\left(y \cdot x + y \cdot x\right) + y \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r30203560 = x;
        double r30203561 = y;
        double r30203562 = r30203560 + r30203561;
        double r30203563 = r30203562 * r30203562;
        return r30203563;
}

double f(double x, double y) {
        double r30203564 = y;
        double r30203565 = x;
        double r30203566 = r30203564 * r30203565;
        double r30203567 = r30203566 + r30203566;
        double r30203568 = r30203564 * r30203564;
        double r30203569 = r30203567 + r30203568;
        double r30203570 = r30203565 * r30203565;
        double r30203571 = r30203569 + r30203570;
        return r30203571;
}

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 + 2 \cdot \left(y \cdot x\right)\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) \cdot \left(x + y\right)\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{{y}^{2} + \left({x}^{2} + 2 \cdot \left(x \cdot y\right)\right)}\]
  3. Simplified0.0

    \[\leadsto \color{blue}{\left(\left(y \cdot x + y \cdot x\right) + y \cdot y\right) + x \cdot x}\]
  4. Final simplification0.0

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

Reproduce

herbie shell --seed 2019163 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f3 from sbv-4.4"

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

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