Average Error: 0.1 → 0.1
Time: 4.1s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(y + z, x + x, \mathsf{fma}\left(t, x, y \cdot 5\right)\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y + z, x + x, \mathsf{fma}\left(t, x, y \cdot 5\right)\right)
double f(double x, double y, double z, double t) {
        double r157740 = x;
        double r157741 = y;
        double r157742 = z;
        double r157743 = r157741 + r157742;
        double r157744 = r157743 + r157742;
        double r157745 = r157744 + r157741;
        double r157746 = t;
        double r157747 = r157745 + r157746;
        double r157748 = r157740 * r157747;
        double r157749 = 5.0;
        double r157750 = r157741 * r157749;
        double r157751 = r157748 + r157750;
        return r157751;
}

double f(double x, double y, double z, double t) {
        double r157752 = y;
        double r157753 = z;
        double r157754 = r157752 + r157753;
        double r157755 = x;
        double r157756 = r157755 + r157755;
        double r157757 = t;
        double r157758 = 5.0;
        double r157759 = r157752 * r157758;
        double r157760 = fma(r157757, r157755, r157759);
        double r157761 = fma(r157754, r157756, r157760);
        return r157761;
}

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

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

Reproduce

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