Average Error: 0.1 → 0.1
Time: 21.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 r129698 = x;
        double r129699 = y;
        double r129700 = z;
        double r129701 = r129699 + r129700;
        double r129702 = r129701 + r129700;
        double r129703 = r129702 + r129699;
        double r129704 = t;
        double r129705 = r129703 + r129704;
        double r129706 = r129698 * r129705;
        double r129707 = 5.0;
        double r129708 = r129699 * r129707;
        double r129709 = r129706 + r129708;
        return r129709;
}

double f(double x, double y, double z, double t) {
        double r129710 = x;
        double r129711 = 2.0;
        double r129712 = y;
        double r129713 = z;
        double r129714 = r129712 + r129713;
        double r129715 = t;
        double r129716 = fma(r129711, r129714, r129715);
        double r129717 = 5.0;
        double r129718 = r129712 * r129717;
        double r129719 = fma(r129710, r129716, r129718);
        return r129719;
}

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