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.0\]
\[\mathsf{fma}\left(x, \mathsf{fma}\left(y + z, 2, t\right), y \cdot 5.0\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0
\mathsf{fma}\left(x, \mathsf{fma}\left(y + z, 2, t\right), y \cdot 5.0\right)
double f(double x, double y, double z, double t) {
        double r6700945 = x;
        double r6700946 = y;
        double r6700947 = z;
        double r6700948 = r6700946 + r6700947;
        double r6700949 = r6700948 + r6700947;
        double r6700950 = r6700949 + r6700946;
        double r6700951 = t;
        double r6700952 = r6700950 + r6700951;
        double r6700953 = r6700945 * r6700952;
        double r6700954 = 5.0;
        double r6700955 = r6700946 * r6700954;
        double r6700956 = r6700953 + r6700955;
        return r6700956;
}

double f(double x, double y, double z, double t) {
        double r6700957 = x;
        double r6700958 = y;
        double r6700959 = z;
        double r6700960 = r6700958 + r6700959;
        double r6700961 = 2.0;
        double r6700962 = t;
        double r6700963 = fma(r6700960, r6700961, r6700962);
        double r6700964 = 5.0;
        double r6700965 = r6700958 * r6700964;
        double r6700966 = fma(r6700957, r6700963, r6700965);
        return r6700966;
}

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.0\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(y + z, 2, t\right), y \cdot 5.0\right)}\]
  3. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y + z, 2, t\right), y \cdot 5.0\right)\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))