Average Error: 0.1 → 0.1
Time: 6.6s
Precision: 64
\[x \cdot \left(y + z\right) + z \cdot 5\]
\[\left(x + 5\right) \cdot z + x \cdot y\]
x \cdot \left(y + z\right) + z \cdot 5
\left(x + 5\right) \cdot z + x \cdot y
double f(double x, double y, double z) {
        double r334086 = x;
        double r334087 = y;
        double r334088 = z;
        double r334089 = r334087 + r334088;
        double r334090 = r334086 * r334089;
        double r334091 = 5.0;
        double r334092 = r334088 * r334091;
        double r334093 = r334090 + r334092;
        return r334093;
}

double f(double x, double y, double z) {
        double r334094 = x;
        double r334095 = 5.0;
        double r334096 = r334094 + r334095;
        double r334097 = z;
        double r334098 = r334096 * r334097;
        double r334099 = y;
        double r334100 = r334094 * r334099;
        double r334101 = r334098 + r334100;
        return r334101;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(x + 5\right) \cdot z + x \cdot y\]

Derivation

  1. Initial program 0.1

    \[x \cdot \left(y + z\right) + z \cdot 5\]
  2. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{x \cdot z + \left(5 \cdot z + x \cdot y\right)}\]
  3. Simplified0.1

    \[\leadsto \color{blue}{\left(x + 5\right) \cdot z + x \cdot y}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.1

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

    \[\leadsto \left(x + 5\right) \cdot z + x \cdot y\]

Reproduce

herbie shell --seed 2019235 
(FPCore (x y z)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
  :precision binary64

  :herbie-target
  (+ (* (+ x 5) z) (* x y))

  (+ (* x (+ y z)) (* z 5)))