Average Error: 0.1 → 0.1
Time: 9.1s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(y + z, x + x, \mathsf{fma}\left(t, x, y \cdot 5\right)\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y + z, x + x, \mathsf{fma}\left(t, x, y \cdot 5\right)\right)
double f(double x, double y, double z, double t) {
        double r211517 = x;
        double r211518 = y;
        double r211519 = z;
        double r211520 = r211518 + r211519;
        double r211521 = r211520 + r211519;
        double r211522 = r211521 + r211518;
        double r211523 = t;
        double r211524 = r211522 + r211523;
        double r211525 = r211517 * r211524;
        double r211526 = 5.0;
        double r211527 = r211518 * r211526;
        double r211528 = r211525 + r211527;
        return r211528;
}

double f(double x, double y, double z, double t) {
        double r211529 = y;
        double r211530 = z;
        double r211531 = r211529 + r211530;
        double r211532 = x;
        double r211533 = r211532 + r211532;
        double r211534 = t;
        double r211535 = 5.0;
        double r211536 = r211529 * r211535;
        double r211537 = fma(r211534, r211532, r211536);
        double r211538 = fma(r211531, r211533, r211537);
        return r211538;
}

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 + z, x + x, \mathsf{fma}\left(t, x, y \cdot 5\right)\right)}\]
  3. Final simplification0.1

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

Reproduce

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