Average Error: 0.1 → 0.1
Time: 4.4s
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 r149823 = x;
        double r149824 = y;
        double r149825 = z;
        double r149826 = r149824 + r149825;
        double r149827 = r149826 + r149825;
        double r149828 = r149827 + r149824;
        double r149829 = t;
        double r149830 = r149828 + r149829;
        double r149831 = r149823 * r149830;
        double r149832 = 5.0;
        double r149833 = r149824 * r149832;
        double r149834 = r149831 + r149833;
        return r149834;
}

double f(double x, double y, double z, double t) {
        double r149835 = y;
        double r149836 = z;
        double r149837 = r149835 + r149836;
        double r149838 = x;
        double r149839 = r149838 + r149838;
        double r149840 = t;
        double r149841 = 5.0;
        double r149842 = r149835 * r149841;
        double r149843 = fma(r149840, r149838, r149842);
        double r149844 = fma(r149837, r149839, r149843);
        return r149844;
}

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