Average Error: 0.0 → 0
Time: 10.9s
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 r348687 = x;
        double r348688 = y;
        double r348689 = r348687 + r348688;
        double r348690 = r348689 + r348687;
        return r348690;
}

double f(double x, double y) {
        double r348691 = 2.0;
        double r348692 = x;
        double r348693 = r348691 * r348692;
        double r348694 = y;
        double r348695 = r348693 + r348694;
        return r348695;
}

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 flip-+47.5

    \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}{\left(x + y\right) - x}}\]
  4. Simplified47.5

    \[\leadsto \frac{\color{blue}{y \cdot \left(\left(x + y\right) + x\right)}}{\left(x + y\right) - x}\]
  5. Simplified23.5

    \[\leadsto \frac{y \cdot \left(\left(x + y\right) + x\right)}{\color{blue}{y}}\]
  6. Using strategy rm
  7. Applied clear-num23.6

    \[\leadsto \color{blue}{\frac{1}{\frac{y}{y \cdot \left(\left(x + y\right) + x\right)}}}\]
  8. Simplified0.2

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(x + y\right) + x}}}\]
  9. Using strategy rm
  10. Applied *-un-lft-identity0.2

    \[\leadsto \frac{1}{\frac{1}{\color{blue}{1 \cdot \left(\left(x + y\right) + x\right)}}}\]
  11. Applied add-cube-cbrt0.2

    \[\leadsto \frac{1}{\frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{1 \cdot \left(\left(x + y\right) + x\right)}}\]
  12. Applied times-frac0.2

    \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\sqrt[3]{1}}{\left(x + y\right) + x}}}\]
  13. Applied add-cube-cbrt0.2

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\sqrt[3]{1}}{\left(x + y\right) + x}}\]
  14. Applied times-frac0.2

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt[3]{1}}{\left(x + y\right) + x}}}\]
  15. Simplified0.2

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt[3]{1}}{\left(x + y\right) + x}}\]
  16. Simplified0

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

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

Reproduce

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