Average Error: 0.0 → 0
Time: 4.5s
Precision: 64
\[\left(x + y\right) + x\]
\[2 \cdot x + y\]
\left(x + y\right) + x
2 \cdot x + y
double f(double x, double y) {
        double r547783 = x;
        double r547784 = y;
        double r547785 = r547783 + r547784;
        double r547786 = r547785 + r547783;
        return r547786;
}

double f(double x, double y) {
        double r547787 = 2.0;
        double r547788 = x;
        double r547789 = r547787 * r547788;
        double r547790 = y;
        double r547791 = r547789 + r547790;
        return r547791;
}

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
Herbie0
\[y + 2 \cdot x\]

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) + x\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt32.5

    \[\leadsto \color{blue}{\sqrt{\left(x + y\right) + x} \cdot \sqrt{\left(x + y\right) + x}}\]
  4. Using strategy rm
  5. Applied flip-+55.7

    \[\leadsto \sqrt{\left(x + y\right) + x} \cdot \sqrt{\color{blue}{\frac{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}{\left(x + y\right) - x}}}\]
  6. Applied sqrt-div55.9

    \[\leadsto \sqrt{\left(x + y\right) + x} \cdot \color{blue}{\frac{\sqrt{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}}{\sqrt{\left(x + y\right) - x}}}\]
  7. Applied flip-+55.9

    \[\leadsto \sqrt{\color{blue}{\frac{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}{\left(x + y\right) - x}}} \cdot \frac{\sqrt{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}}{\sqrt{\left(x + y\right) - x}}\]
  8. Applied sqrt-div55.9

    \[\leadsto \color{blue}{\frac{\sqrt{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}}{\sqrt{\left(x + y\right) - x}}} \cdot \frac{\sqrt{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}}{\sqrt{\left(x + y\right) - x}}\]
  9. Applied frac-times55.9

    \[\leadsto \color{blue}{\frac{\sqrt{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x} \cdot \sqrt{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}}{\sqrt{\left(x + y\right) - x} \cdot \sqrt{\left(x + y\right) - x}}}\]
  10. Simplified55.8

    \[\leadsto \frac{\color{blue}{\left(2 \cdot x + y\right) \cdot \left(0 + y\right)}}{\sqrt{\left(x + y\right) - x} \cdot \sqrt{\left(x + y\right) - x}}\]
  11. Simplified23.1

    \[\leadsto \frac{\left(2 \cdot x + y\right) \cdot \left(0 + y\right)}{\color{blue}{0 + y}}\]
  12. Taylor expanded around 0 0

    \[\leadsto \color{blue}{2 \cdot x + y}\]
  13. Final simplification0

    \[\leadsto 2 \cdot x + y\]

Reproduce

herbie shell --seed 2020045 
(FPCore (x y)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, A"
  :precision binary64

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

  (+ (+ x y) x))