Average Error: 0.1 → 0.1
Time: 19.1s
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 r7160844 = x;
        double r7160845 = y;
        double r7160846 = z;
        double r7160847 = r7160845 + r7160846;
        double r7160848 = r7160847 + r7160846;
        double r7160849 = r7160848 + r7160845;
        double r7160850 = t;
        double r7160851 = r7160849 + r7160850;
        double r7160852 = r7160844 * r7160851;
        double r7160853 = 5.0;
        double r7160854 = r7160845 * r7160853;
        double r7160855 = r7160852 + r7160854;
        return r7160855;
}

double f(double x, double y, double z, double t) {
        double r7160856 = z;
        double r7160857 = y;
        double r7160858 = r7160856 + r7160857;
        double r7160859 = 2.0;
        double r7160860 = t;
        double r7160861 = fma(r7160858, r7160859, r7160860);
        double r7160862 = x;
        double r7160863 = 5.0;
        double r7160864 = r7160863 * r7160857;
        double r7160865 = fma(r7160861, r7160862, r7160864);
        return r7160865;
}

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