Average Error: 0.1 → 0.1
Time: 20.5s
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 r119319 = x;
        double r119320 = y;
        double r119321 = z;
        double r119322 = r119320 + r119321;
        double r119323 = r119322 + r119321;
        double r119324 = r119323 + r119320;
        double r119325 = t;
        double r119326 = r119324 + r119325;
        double r119327 = r119319 * r119326;
        double r119328 = 5.0;
        double r119329 = r119320 * r119328;
        double r119330 = r119327 + r119329;
        return r119330;
}

double f(double x, double y, double z, double t) {
        double r119331 = x;
        double r119332 = 2.0;
        double r119333 = y;
        double r119334 = z;
        double r119335 = r119333 + r119334;
        double r119336 = t;
        double r119337 = fma(r119332, r119335, r119336);
        double r119338 = 5.0;
        double r119339 = r119333 * r119338;
        double r119340 = fma(r119331, r119337, r119339);
        return r119340;
}

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