Average Error: 0.1 → 0.1
Time: 7.8s
Precision: 64
\[x \cdot \left(y + z\right) + z \cdot 5\]
\[x \cdot y + z \cdot \left(x + 5\right)\]
x \cdot \left(y + z\right) + z \cdot 5
x \cdot y + z \cdot \left(x + 5\right)
double f(double x, double y, double z) {
        double r484406 = x;
        double r484407 = y;
        double r484408 = z;
        double r484409 = r484407 + r484408;
        double r484410 = r484406 * r484409;
        double r484411 = 5.0;
        double r484412 = r484408 * r484411;
        double r484413 = r484410 + r484412;
        return r484413;
}

double f(double x, double y, double z) {
        double r484414 = x;
        double r484415 = y;
        double r484416 = r484414 * r484415;
        double r484417 = z;
        double r484418 = 5.0;
        double r484419 = r484414 + r484418;
        double r484420 = r484417 * r484419;
        double r484421 = r484416 + r484420;
        return r484421;
}

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. Applied associate-+l+0.1

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

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

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

Reproduce

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