Average Error: 0.0 → 0
Time: 10.4s
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 r432145 = x;
        double r432146 = y;
        double r432147 = r432145 + r432146;
        double r432148 = r432147 + r432145;
        return r432148;
}

double f(double x, double y) {
        double r432149 = 2.0;
        double r432150 = x;
        double r432151 = r432149 * r432150;
        double r432152 = y;
        double r432153 = r432151 + r432152;
        return r432153;
}

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.4

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

    \[\leadsto \color{blue}{\sqrt{\sqrt{\left(x + y\right) + x} \cdot \sqrt{\left(x + y\right) + x}} \cdot \sqrt{\sqrt{\left(x + y\right) + x} \cdot \sqrt{\left(x + y\right) + x}}}\]
  6. Simplified32.4

    \[\leadsto \color{blue}{\sqrt{2 \cdot x + y}} \cdot \sqrt{\sqrt{\left(x + y\right) + x} \cdot \sqrt{\left(x + y\right) + x}}\]
  7. Simplified32.4

    \[\leadsto \sqrt{2 \cdot x + y} \cdot \color{blue}{\sqrt{2 \cdot x + y}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity32.4

    \[\leadsto \sqrt{\color{blue}{1 \cdot \left(2 \cdot x + y\right)}} \cdot \sqrt{2 \cdot x + y}\]
  10. Applied sqrt-prod32.4

    \[\leadsto \color{blue}{\left(\sqrt{1} \cdot \sqrt{2 \cdot x + y}\right)} \cdot \sqrt{2 \cdot x + y}\]
  11. Applied associate-*l*32.4

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

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

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

Reproduce

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