Average Error: 0.0 → 0.0
Time: 9.7s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left({y}^{2} + x \cdot y\right) + x \cdot \left(x + y\right)\]
\left(x + y\right) \cdot \left(x + y\right)
\left({y}^{2} + x \cdot y\right) + x \cdot \left(x + y\right)
double f(double x, double y) {
        double r504518 = x;
        double r504519 = y;
        double r504520 = r504518 + r504519;
        double r504521 = r504520 * r504520;
        return r504521;
}

double f(double x, double y) {
        double r504522 = y;
        double r504523 = 2.0;
        double r504524 = pow(r504522, r504523);
        double r504525 = x;
        double r504526 = r504525 * r504522;
        double r504527 = r504524 + r504526;
        double r504528 = r504525 + r504522;
        double r504529 = r504525 * r504528;
        double r504530 = r504527 + r504529;
        return r504530;
}

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 \color{blue}{\left(y \cdot y + y \cdot x\right)} + x \cdot \left(y + x\right)\]
  9. Simplified0.0

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

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

    \[\leadsto \left({y}^{2} + x \cdot y\right) + x \cdot \left(x + y\right)\]

Reproduce

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