Average Error: 0.1 → 0.1
Time: 14.2s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r155068 = x;
        double r155069 = y;
        double r155070 = z;
        double r155071 = r155069 + r155070;
        double r155072 = r155071 + r155070;
        double r155073 = r155072 + r155069;
        double r155074 = t;
        double r155075 = r155073 + r155074;
        double r155076 = r155068 * r155075;
        double r155077 = 5.0;
        double r155078 = r155069 * r155077;
        double r155079 = r155076 + r155078;
        return r155079;
}

double f(double x, double y, double z, double t) {
        double r155080 = x;
        double r155081 = 2.0;
        double r155082 = y;
        double r155083 = z;
        double r155084 = r155082 + r155083;
        double r155085 = t;
        double r155086 = fma(r155081, r155084, r155085);
        double r155087 = 5.0;
        double r155088 = r155082 * r155087;
        double r155089 = fma(r155080, r155086, r155088);
        return r155089;
}

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(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)}\]
  3. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)\]

Reproduce

herbie shell --seed 2020043 +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)))