Average Error: 0.0 → 0.0
Time: 3.7s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y\]
\[\left(2.0 \cdot y\right) \cdot x + \left(y \cdot y + x \cdot x\right)\]
\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y
\left(2.0 \cdot y\right) \cdot x + \left(y \cdot y + x \cdot x\right)
double f(double x, double y) {
        double r33079462 = x;
        double r33079463 = r33079462 * r33079462;
        double r33079464 = 2.0;
        double r33079465 = r33079462 * r33079464;
        double r33079466 = y;
        double r33079467 = r33079465 * r33079466;
        double r33079468 = r33079463 + r33079467;
        double r33079469 = r33079466 * r33079466;
        double r33079470 = r33079468 + r33079469;
        return r33079470;
}

double f(double x, double y) {
        double r33079471 = 2.0;
        double r33079472 = y;
        double r33079473 = r33079471 * r33079472;
        double r33079474 = x;
        double r33079475 = r33079473 * r33079474;
        double r33079476 = r33079472 * r33079472;
        double r33079477 = r33079474 * r33079474;
        double r33079478 = r33079476 + r33079477;
        double r33079479 = r33079475 + r33079478;
        return r33079479;
}

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.0\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot y + x \cdot \left(x + y \cdot 2.0\right)}\]
  3. Using strategy rm
  4. Applied distribute-rgt-in0.0

    \[\leadsto y \cdot y + \color{blue}{\left(x \cdot x + \left(y \cdot 2.0\right) \cdot x\right)}\]
  5. Applied associate-+r+0.0

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

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

Reproduce

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