Average Error: 0.0 → 0.0
Time: 5.5s
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 r30292535 = x;
        double r30292536 = y;
        double r30292537 = r30292535 + r30292536;
        double r30292538 = r30292537 * r30292537;
        return r30292538;
}

double f(double x, double y) {
        double r30292539 = y;
        double r30292540 = x;
        double r30292541 = r30292539 * r30292540;
        double r30292542 = r30292541 + r30292541;
        double r30292543 = r30292539 * r30292539;
        double r30292544 = r30292542 + r30292543;
        double r30292545 = r30292540 * r30292540;
        double r30292546 = r30292544 + r30292545;
        return r30292546;
}

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