Average Error: 0.0 → 0
Time: 2.5s
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 r387699 = x;
        double r387700 = y;
        double r387701 = r387699 + r387700;
        double r387702 = r387701 + r387699;
        return r387702;
}

double f(double x, double y) {
        double r387703 = 2.0;
        double r387704 = x;
        double r387705 = r387703 * r387704;
        double r387706 = y;
        double r387707 = r387705 + r387706;
        return r387707;
}

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

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

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

Reproduce

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