Average Error: 0.0 → 0.0
Time: 6.2s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left(y \cdot x + \left(x + y\right) \cdot y\right) + x \cdot x\]
\left(x + y\right) \cdot \left(x + y\right)
\left(y \cdot x + \left(x + y\right) \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r529758 = x;
        double r529759 = y;
        double r529760 = r529758 + r529759;
        double r529761 = r529760 * r529760;
        return r529761;
}

double f(double x, double y) {
        double r529762 = y;
        double r529763 = x;
        double r529764 = r529762 * r529763;
        double r529765 = r529763 + r529762;
        double r529766 = r529765 * r529762;
        double r529767 = r529764 + r529766;
        double r529768 = r529763 * r529763;
        double r529769 = r529767 + r529768;
        return r529769;
}

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. Simplified0.0

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

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

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

    \[\leadsto y \cdot \left(y + x\right) + \color{blue}{x \cdot \left(y + x\right)}\]
  7. Using strategy rm
  8. Applied distribute-lft-in0.0

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

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

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

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

Reproduce

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

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

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