Average Error: 0.1 → 0.1
Time: 24.0s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0\]
\[\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5.0 \cdot y\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0
\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5.0 \cdot y\right)
double f(double x, double y, double z, double t) {
        double r8768058 = x;
        double r8768059 = y;
        double r8768060 = z;
        double r8768061 = r8768059 + r8768060;
        double r8768062 = r8768061 + r8768060;
        double r8768063 = r8768062 + r8768059;
        double r8768064 = t;
        double r8768065 = r8768063 + r8768064;
        double r8768066 = r8768058 * r8768065;
        double r8768067 = 5.0;
        double r8768068 = r8768059 * r8768067;
        double r8768069 = r8768066 + r8768068;
        return r8768069;
}

double f(double x, double y, double z, double t) {
        double r8768070 = z;
        double r8768071 = y;
        double r8768072 = r8768070 + r8768071;
        double r8768073 = 2.0;
        double r8768074 = t;
        double r8768075 = fma(r8768072, r8768073, r8768074);
        double r8768076 = x;
        double r8768077 = 5.0;
        double r8768078 = r8768077 * r8768071;
        double r8768079 = fma(r8768075, r8768076, r8768078);
        return r8768079;
}

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(\mathsf{fma}\left(y + z, 2, t\right), x, y \cdot 5.0\right)}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2019164 +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)))