Average Error: 0.0 → 0.0
Time: 6.0s
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 r36105009 = x;
        double r36105010 = y;
        double r36105011 = r36105009 + r36105010;
        double r36105012 = r36105011 * r36105011;
        return r36105012;
}

double f(double x, double y) {
        double r36105013 = y;
        double r36105014 = x;
        double r36105015 = r36105013 * r36105014;
        double r36105016 = r36105015 + r36105015;
        double r36105017 = r36105013 * r36105013;
        double r36105018 = r36105016 + r36105017;
        double r36105019 = r36105014 * r36105014;
        double r36105020 = r36105018 + r36105019;
        return r36105020;
}

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