Average Error: 0.1 → 0.1
Time: 4.9s
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 r130300 = x;
        double r130301 = y;
        double r130302 = z;
        double r130303 = r130301 + r130302;
        double r130304 = r130303 + r130302;
        double r130305 = r130304 + r130301;
        double r130306 = t;
        double r130307 = r130305 + r130306;
        double r130308 = r130300 * r130307;
        double r130309 = 5.0;
        double r130310 = r130301 * r130309;
        double r130311 = r130308 + r130310;
        return r130311;
}

double f(double x, double y, double z, double t) {
        double r130312 = y;
        double r130313 = z;
        double r130314 = r130312 + r130313;
        double r130315 = x;
        double r130316 = r130315 + r130315;
        double r130317 = t;
        double r130318 = 5.0;
        double r130319 = r130312 * r130318;
        double r130320 = fma(r130317, r130315, r130319);
        double r130321 = fma(r130314, r130316, r130320);
        return r130321;
}

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