Average Error: 0.1 → 0.1
Time: 5.0s
Precision: 64
\[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x\]
\[3 \cdot x + \left(z + 2 \cdot y\right)\]
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
3 \cdot x + \left(z + 2 \cdot y\right)
double f(double x, double y, double z) {
        double r242464 = x;
        double r242465 = y;
        double r242466 = r242464 + r242465;
        double r242467 = r242466 + r242465;
        double r242468 = r242467 + r242464;
        double r242469 = z;
        double r242470 = r242468 + r242469;
        double r242471 = r242470 + r242464;
        return r242471;
}

double f(double x, double y, double z) {
        double r242472 = 3.0;
        double r242473 = x;
        double r242474 = r242472 * r242473;
        double r242475 = z;
        double r242476 = 2.0;
        double r242477 = y;
        double r242478 = r242476 * r242477;
        double r242479 = r242475 + r242478;
        double r242480 = r242474 + r242479;
        return r242480;
}

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 add-sqr-sqrt32.5

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x + y\right) + \left(x + z\right)} \cdot \sqrt{2 \cdot \left(x + y\right) + \left(x + z\right)}}\]
  5. Taylor expanded around 0 0.1

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

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

Reproduce

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