Average Error: 0.1 → 0.1
Time: 27.5s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0\]
\[\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5.0 \cdot y\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0
\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5.0 \cdot y\right)
double f(double x, double y, double z, double t) {
        double r9337611 = x;
        double r9337612 = y;
        double r9337613 = z;
        double r9337614 = r9337612 + r9337613;
        double r9337615 = r9337614 + r9337613;
        double r9337616 = r9337615 + r9337612;
        double r9337617 = t;
        double r9337618 = r9337616 + r9337617;
        double r9337619 = r9337611 * r9337618;
        double r9337620 = 5.0;
        double r9337621 = r9337612 * r9337620;
        double r9337622 = r9337619 + r9337621;
        return r9337622;
}

double f(double x, double y, double z, double t) {
        double r9337623 = z;
        double r9337624 = y;
        double r9337625 = r9337623 + r9337624;
        double r9337626 = 2.0;
        double r9337627 = t;
        double r9337628 = fma(r9337625, r9337626, r9337627);
        double r9337629 = x;
        double r9337630 = 5.0;
        double r9337631 = r9337630 * r9337624;
        double r9337632 = fma(r9337628, r9337629, r9337631);
        return r9337632;
}

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.0\]
  2. Simplified0.1

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

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

Reproduce

herbie shell --seed 2019163 +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)))