Average Error: 0.1 → 0.1
Time: 2.8s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(x, \left(\left(\left(y + z\right) + z\right) + y\right) + t, 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, \left(\left(\left(y + z\right) + z\right) + y\right) + t, y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r137123 = x;
        double r137124 = y;
        double r137125 = z;
        double r137126 = r137124 + r137125;
        double r137127 = r137126 + r137125;
        double r137128 = r137127 + r137124;
        double r137129 = t;
        double r137130 = r137128 + r137129;
        double r137131 = r137123 * r137130;
        double r137132 = 5.0;
        double r137133 = r137124 * r137132;
        double r137134 = r137131 + r137133;
        return r137134;
}

double f(double x, double y, double z, double t) {
        double r137135 = x;
        double r137136 = y;
        double r137137 = z;
        double r137138 = r137136 + r137137;
        double r137139 = r137138 + r137137;
        double r137140 = r137139 + r137136;
        double r137141 = t;
        double r137142 = r137140 + r137141;
        double r137143 = 5.0;
        double r137144 = r137136 * r137143;
        double r137145 = fma(r137135, r137142, r137144);
        return r137145;
}

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. Using strategy rm
  3. Applied fma-def0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \left(\left(\left(y + z\right) + z\right) + y\right) + t, y \cdot 5\right)}\]
  4. Final simplification0.1

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

Reproduce

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