Average Error: 0.0 → 0
Time: 2.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 r485365 = x;
        double r485366 = y;
        double r485367 = r485365 + r485366;
        double r485368 = r485367 + r485365;
        return r485368;
}

double f(double x, double y) {
        double r485369 = 2.0;
        double r485370 = x;
        double r485371 = r485369 * r485370;
        double r485372 = y;
        double r485373 = r485371 + r485372;
        return r485373;
}

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. Taylor expanded around 0 0

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

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

Reproduce

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