Average Error: 0.1 → 0.1
Time: 3.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 r133234 = x;
        double r133235 = y;
        double r133236 = z;
        double r133237 = r133235 + r133236;
        double r133238 = r133237 + r133236;
        double r133239 = r133238 + r133235;
        double r133240 = t;
        double r133241 = r133239 + r133240;
        double r133242 = r133234 * r133241;
        double r133243 = 5.0;
        double r133244 = r133235 * r133243;
        double r133245 = r133242 + r133244;
        return r133245;
}

double f(double x, double y, double z, double t) {
        double r133246 = y;
        double r133247 = z;
        double r133248 = r133246 + r133247;
        double r133249 = x;
        double r133250 = r133249 + r133249;
        double r133251 = t;
        double r133252 = 5.0;
        double r133253 = r133246 * r133252;
        double r133254 = fma(r133251, r133249, r133253);
        double r133255 = fma(r133248, r133250, r133254);
        return r133255;
}

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