Average Error: 0.1 → 0.1
Time: 19.6s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5 \cdot y\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5 \cdot y\right)
double f(double x, double y, double z, double t) {
        double r6309739 = x;
        double r6309740 = y;
        double r6309741 = z;
        double r6309742 = r6309740 + r6309741;
        double r6309743 = r6309742 + r6309741;
        double r6309744 = r6309743 + r6309740;
        double r6309745 = t;
        double r6309746 = r6309744 + r6309745;
        double r6309747 = r6309739 * r6309746;
        double r6309748 = 5.0;
        double r6309749 = r6309740 * r6309748;
        double r6309750 = r6309747 + r6309749;
        return r6309750;
}

double f(double x, double y, double z, double t) {
        double r6309751 = z;
        double r6309752 = y;
        double r6309753 = r6309751 + r6309752;
        double r6309754 = 2.0;
        double r6309755 = t;
        double r6309756 = fma(r6309753, r6309754, r6309755);
        double r6309757 = x;
        double r6309758 = 5.0;
        double r6309759 = r6309758 * r6309752;
        double r6309760 = fma(r6309756, r6309757, r6309759);
        return r6309760;
}

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

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

Reproduce

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