Average Error: 0.1 → 0.1
Time: 31.5s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(\mathsf{fma}\left(2, y + z, t\right), x, 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(\mathsf{fma}\left(2, y + z, t\right), x, y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r19044650 = x;
        double r19044651 = y;
        double r19044652 = z;
        double r19044653 = r19044651 + r19044652;
        double r19044654 = r19044653 + r19044652;
        double r19044655 = r19044654 + r19044651;
        double r19044656 = t;
        double r19044657 = r19044655 + r19044656;
        double r19044658 = r19044650 * r19044657;
        double r19044659 = 5.0;
        double r19044660 = r19044651 * r19044659;
        double r19044661 = r19044658 + r19044660;
        return r19044661;
}

double f(double x, double y, double z, double t) {
        double r19044662 = 2.0;
        double r19044663 = y;
        double r19044664 = z;
        double r19044665 = r19044663 + r19044664;
        double r19044666 = t;
        double r19044667 = fma(r19044662, r19044665, r19044666);
        double r19044668 = x;
        double r19044669 = 5.0;
        double r19044670 = r19044663 * r19044669;
        double r19044671 = fma(r19044667, r19044668, r19044670);
        return r19044671;
}

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

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

Reproduce

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