Average Error: 0.1 → 0.1
Time: 25.9s
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 r6378749 = x;
        double r6378750 = y;
        double r6378751 = z;
        double r6378752 = r6378750 + r6378751;
        double r6378753 = r6378752 + r6378751;
        double r6378754 = r6378753 + r6378750;
        double r6378755 = t;
        double r6378756 = r6378754 + r6378755;
        double r6378757 = r6378749 * r6378756;
        double r6378758 = 5.0;
        double r6378759 = r6378750 * r6378758;
        double r6378760 = r6378757 + r6378759;
        return r6378760;
}

double f(double x, double y, double z, double t) {
        double r6378761 = z;
        double r6378762 = y;
        double r6378763 = r6378761 + r6378762;
        double r6378764 = 2.0;
        double r6378765 = t;
        double r6378766 = fma(r6378763, r6378764, r6378765);
        double r6378767 = x;
        double r6378768 = 5.0;
        double r6378769 = r6378768 * r6378762;
        double r6378770 = fma(r6378766, r6378767, r6378769);
        return r6378770;
}

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