Average Error: 0.1 → 0.1
Time: 4.0s
Precision: 64
\[x \cdot \left(y + z\right) + z \cdot 5\]
\[\left(x \cdot y + x \cdot z\right) + z \cdot 5\]
x \cdot \left(y + z\right) + z \cdot 5
\left(x \cdot y + x \cdot z\right) + z \cdot 5
double f(double x, double y, double z) {
        double r461263 = x;
        double r461264 = y;
        double r461265 = z;
        double r461266 = r461264 + r461265;
        double r461267 = r461263 * r461266;
        double r461268 = 5.0;
        double r461269 = r461265 * r461268;
        double r461270 = r461267 + r461269;
        return r461270;
}

double f(double x, double y, double z) {
        double r461271 = x;
        double r461272 = y;
        double r461273 = r461271 * r461272;
        double r461274 = z;
        double r461275 = r461271 * r461274;
        double r461276 = r461273 + r461275;
        double r461277 = 5.0;
        double r461278 = r461274 * r461277;
        double r461279 = r461276 + r461278;
        return r461279;
}

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. Using strategy rm
  3. Applied distribute-lft-in0.1

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

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

Reproduce

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