Average Error: 0.1 → 0.1
Time: 12.6s
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 r208509 = x;
        double r208510 = y;
        double r208511 = z;
        double r208512 = r208510 + r208511;
        double r208513 = r208512 + r208511;
        double r208514 = r208513 + r208510;
        double r208515 = t;
        double r208516 = r208514 + r208515;
        double r208517 = r208509 * r208516;
        double r208518 = 5.0;
        double r208519 = r208510 * r208518;
        double r208520 = r208517 + r208519;
        return r208520;
}

double f(double x, double y, double z, double t) {
        double r208521 = x;
        double r208522 = 2.0;
        double r208523 = y;
        double r208524 = z;
        double r208525 = r208523 + r208524;
        double r208526 = t;
        double r208527 = fma(r208522, r208525, r208526);
        double r208528 = 5.0;
        double r208529 = r208523 * r208528;
        double r208530 = fma(r208521, r208527, r208529);
        return r208530;
}

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