Average Error: 0.0 → 0
Time: 9.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 r415382 = x;
        double r415383 = y;
        double r415384 = r415382 + r415383;
        double r415385 = r415384 + r415382;
        return r415385;
}

double f(double x, double y) {
        double r415386 = 2.0;
        double r415387 = x;
        double r415388 = r415386 * r415387;
        double r415389 = y;
        double r415390 = r415388 + r415389;
        return r415390;
}

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 add-sqr-sqrt32.5

    \[\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.5

    \[\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.5

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

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

    \[\leadsto \sqrt{2 \cdot x + y} \cdot \color{blue}{\left(\sqrt{1} \cdot \sqrt{2 \cdot x + y}\right)}\]
  11. Applied *-un-lft-identity32.5

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

    \[\leadsto \color{blue}{\left(\sqrt{1} \cdot \sqrt{2 \cdot x + y}\right)} \cdot \left(\sqrt{1} \cdot \sqrt{2 \cdot x + y}\right)\]
  13. Applied swap-sqr32.5

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

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

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

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

Reproduce

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