Average Error: 0.1 → 0.1
Time: 24.9s
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 r7493523 = x;
        double r7493524 = y;
        double r7493525 = z;
        double r7493526 = r7493524 + r7493525;
        double r7493527 = r7493526 + r7493525;
        double r7493528 = r7493527 + r7493524;
        double r7493529 = t;
        double r7493530 = r7493528 + r7493529;
        double r7493531 = r7493523 * r7493530;
        double r7493532 = 5.0;
        double r7493533 = r7493524 * r7493532;
        double r7493534 = r7493531 + r7493533;
        return r7493534;
}

double f(double x, double y, double z, double t) {
        double r7493535 = z;
        double r7493536 = y;
        double r7493537 = r7493535 + r7493536;
        double r7493538 = 2.0;
        double r7493539 = t;
        double r7493540 = fma(r7493537, r7493538, r7493539);
        double r7493541 = x;
        double r7493542 = 5.0;
        double r7493543 = r7493542 * r7493536;
        double r7493544 = fma(r7493540, r7493541, r7493543);
        return r7493544;
}

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 2019158 +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)))