Average Error: 0.1 → 0.1
Time: 6.4s
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 r734 = x;
        double r735 = y;
        double r736 = z;
        double r737 = r735 + r736;
        double r738 = r737 + r736;
        double r739 = r738 + r735;
        double r740 = t;
        double r741 = r739 + r740;
        double r742 = r734 * r741;
        double r743 = 5.0;
        double r744 = r735 * r743;
        double r745 = r742 + r744;
        return r745;
}

double f(double x, double y, double z, double t) {
        double r746 = y;
        double r747 = z;
        double r748 = r746 + r747;
        double r749 = x;
        double r750 = r749 + r749;
        double r751 = t;
        double r752 = 5.0;
        double r753 = r746 * r752;
        double r754 = fma(r751, r749, r753);
        double r755 = fma(r748, r750, r754);
        return r755;
}

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