Average Error: 0.1 → 0.1
Time: 21.3s
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 r143508 = x;
        double r143509 = y;
        double r143510 = z;
        double r143511 = r143509 + r143510;
        double r143512 = r143511 + r143510;
        double r143513 = r143512 + r143509;
        double r143514 = t;
        double r143515 = r143513 + r143514;
        double r143516 = r143508 * r143515;
        double r143517 = 5.0;
        double r143518 = r143509 * r143517;
        double r143519 = r143516 + r143518;
        return r143519;
}

double f(double x, double y, double z, double t) {
        double r143520 = x;
        double r143521 = 2.0;
        double r143522 = y;
        double r143523 = z;
        double r143524 = r143522 + r143523;
        double r143525 = t;
        double r143526 = fma(r143521, r143524, r143525);
        double r143527 = 5.0;
        double r143528 = r143522 * r143527;
        double r143529 = fma(r143520, r143526, r143528);
        return r143529;
}

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