Average Error: 0.1 → 0.1
Time: 13.5s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(y, 5, \mathsf{fma}\left(z + y, 2, t\right) \cdot x\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y, 5, \mathsf{fma}\left(z + y, 2, t\right) \cdot x\right)
double f(double x, double y, double z, double t) {
        double r6189478 = x;
        double r6189479 = y;
        double r6189480 = z;
        double r6189481 = r6189479 + r6189480;
        double r6189482 = r6189481 + r6189480;
        double r6189483 = r6189482 + r6189479;
        double r6189484 = t;
        double r6189485 = r6189483 + r6189484;
        double r6189486 = r6189478 * r6189485;
        double r6189487 = 5.0;
        double r6189488 = r6189479 * r6189487;
        double r6189489 = r6189486 + r6189488;
        return r6189489;
}

double f(double x, double y, double z, double t) {
        double r6189490 = y;
        double r6189491 = 5.0;
        double r6189492 = z;
        double r6189493 = r6189492 + r6189490;
        double r6189494 = 2.0;
        double r6189495 = t;
        double r6189496 = fma(r6189493, r6189494, r6189495);
        double r6189497 = x;
        double r6189498 = r6189496 * r6189497;
        double r6189499 = fma(r6189490, r6189491, r6189498);
        return r6189499;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 0.1

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)}\]
  3. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(z + y, 2, t\right) \cdot x\right)\]

Reproduce

herbie shell --seed 2019171 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))