Average Error: 0.1 → 0.1
Time: 7.3s
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 r244140 = x;
        double r244141 = y;
        double r244142 = z;
        double r244143 = r244141 + r244142;
        double r244144 = r244143 + r244142;
        double r244145 = r244144 + r244141;
        double r244146 = t;
        double r244147 = r244145 + r244146;
        double r244148 = r244140 * r244147;
        double r244149 = 5.0;
        double r244150 = r244141 * r244149;
        double r244151 = r244148 + r244150;
        return r244151;
}

double f(double x, double y, double z, double t) {
        double r244152 = y;
        double r244153 = z;
        double r244154 = r244152 + r244153;
        double r244155 = x;
        double r244156 = r244155 + r244155;
        double r244157 = t;
        double r244158 = 5.0;
        double r244159 = r244152 * r244158;
        double r244160 = fma(r244157, r244155, r244159);
        double r244161 = fma(r244154, r244156, r244160);
        return r244161;
}

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