Average Error: 0.1 → 0.1
Time: 23.4s
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 r142014 = x;
        double r142015 = y;
        double r142016 = z;
        double r142017 = r142015 + r142016;
        double r142018 = r142017 + r142016;
        double r142019 = r142018 + r142015;
        double r142020 = t;
        double r142021 = r142019 + r142020;
        double r142022 = r142014 * r142021;
        double r142023 = 5.0;
        double r142024 = r142015 * r142023;
        double r142025 = r142022 + r142024;
        return r142025;
}

double f(double x, double y, double z, double t) {
        double r142026 = x;
        double r142027 = y;
        double r142028 = z;
        double r142029 = r142027 + r142028;
        double r142030 = r142029 + r142028;
        double r142031 = r142030 + r142027;
        double r142032 = t;
        double r142033 = r142031 + r142032;
        double r142034 = 5.0;
        double r142035 = r142027 * r142034;
        double r142036 = fma(r142026, r142033, r142035);
        return r142036;
}

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