Average Error: 0.0 → 0
Time: 7.3s
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 r326872 = x;
        double r326873 = y;
        double r326874 = r326872 + r326873;
        double r326875 = r326874 + r326872;
        return r326875;
}

double f(double x, double y) {
        double r326876 = 2.0;
        double r326877 = x;
        double r326878 = r326876 * r326877;
        double r326879 = y;
        double r326880 = r326878 + r326879;
        return r326880;
}

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 \sqrt{\left(x + y\right) + x} \cdot \sqrt{\color{blue}{\sqrt{\left(x + y\right) + x} \cdot \sqrt{\left(x + y\right) + x}}}\]
  6. Applied sqrt-prod32.6

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

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

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

Reproduce

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