Average Error: 0.1 → 0.1
Time: 21.3s
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 r7435368 = x;
        double r7435369 = y;
        double r7435370 = z;
        double r7435371 = r7435369 + r7435370;
        double r7435372 = r7435371 + r7435370;
        double r7435373 = r7435372 + r7435369;
        double r7435374 = t;
        double r7435375 = r7435373 + r7435374;
        double r7435376 = r7435368 * r7435375;
        double r7435377 = 5.0;
        double r7435378 = r7435369 * r7435377;
        double r7435379 = r7435376 + r7435378;
        return r7435379;
}

double f(double x, double y, double z, double t) {
        double r7435380 = z;
        double r7435381 = y;
        double r7435382 = r7435380 + r7435381;
        double r7435383 = 2.0;
        double r7435384 = t;
        double r7435385 = fma(r7435382, r7435383, r7435384);
        double r7435386 = x;
        double r7435387 = 5.0;
        double r7435388 = r7435387 * r7435381;
        double r7435389 = fma(r7435385, r7435386, r7435388);
        return r7435389;
}

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