Average Error: 0.1 → 0.1
Time: 4.6s
Precision: 64
\[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x\]
\[2 \cdot x + \left(y \cdot 2 + \left(x + z\right)\right)\]
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
2 \cdot x + \left(y \cdot 2 + \left(x + z\right)\right)
double f(double x, double y, double z) {
        double r157577 = x;
        double r157578 = y;
        double r157579 = r157577 + r157578;
        double r157580 = r157579 + r157578;
        double r157581 = r157580 + r157577;
        double r157582 = z;
        double r157583 = r157581 + r157582;
        double r157584 = r157583 + r157577;
        return r157584;
}

double f(double x, double y, double z) {
        double r157585 = 2.0;
        double r157586 = x;
        double r157587 = r157585 * r157586;
        double r157588 = y;
        double r157589 = r157588 * r157585;
        double r157590 = z;
        double r157591 = r157586 + r157590;
        double r157592 = r157589 + r157591;
        double r157593 = r157587 + r157592;
        return r157593;
}

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

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x\]
  2. Simplified0.1

    \[\leadsto \color{blue}{2 \cdot \left(x + y\right) + \left(x + z\right)}\]
  3. Using strategy rm
  4. Applied distribute-lft-in0.1

    \[\leadsto \color{blue}{\left(2 \cdot x + 2 \cdot y\right)} + \left(x + z\right)\]
  5. Applied associate-+l+0.1

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

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

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

Reproduce

herbie shell --seed 2020047 
(FPCore (x y z)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4"
  :precision binary64
  (+ (+ (+ (+ (+ x y) y) x) z) x))