Average Error: 0.1 → 0.1
Time: 8.1s
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 r137995 = x;
        double r137996 = y;
        double r137997 = z;
        double r137998 = r137996 + r137997;
        double r137999 = r137998 + r137997;
        double r138000 = r137999 + r137996;
        double r138001 = t;
        double r138002 = r138000 + r138001;
        double r138003 = r137995 * r138002;
        double r138004 = 5.0;
        double r138005 = r137996 * r138004;
        double r138006 = r138003 + r138005;
        return r138006;
}

double f(double x, double y, double z, double t) {
        double r138007 = y;
        double r138008 = z;
        double r138009 = r138007 + r138008;
        double r138010 = x;
        double r138011 = r138010 + r138010;
        double r138012 = t;
        double r138013 = 5.0;
        double r138014 = r138007 * r138013;
        double r138015 = fma(r138012, r138010, r138014);
        double r138016 = fma(r138009, r138011, r138015);
        return r138016;
}

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