Average Error: 0.1 → 0.1
Time: 8.9s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[x \cdot \left(\left(\mathsf{fma}\left(2, z, y\right) + y\right) + t\right) + y \cdot 5\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
x \cdot \left(\left(\mathsf{fma}\left(2, z, y\right) + y\right) + t\right) + y \cdot 5
double f(double x, double y, double z, double t) {
        double r227926 = x;
        double r227927 = y;
        double r227928 = z;
        double r227929 = r227927 + r227928;
        double r227930 = r227929 + r227928;
        double r227931 = r227930 + r227927;
        double r227932 = t;
        double r227933 = r227931 + r227932;
        double r227934 = r227926 * r227933;
        double r227935 = 5.0;
        double r227936 = r227927 * r227935;
        double r227937 = r227934 + r227936;
        return r227937;
}

double f(double x, double y, double z, double t) {
        double r227938 = x;
        double r227939 = 2.0;
        double r227940 = z;
        double r227941 = y;
        double r227942 = fma(r227939, r227940, r227941);
        double r227943 = r227942 + r227941;
        double r227944 = t;
        double r227945 = r227943 + r227944;
        double r227946 = r227938 * r227945;
        double r227947 = 5.0;
        double r227948 = r227941 * r227947;
        double r227949 = r227946 + r227948;
        return r227949;
}

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. Taylor expanded around 0 0.1

    \[\leadsto x \cdot \left(\left(\color{blue}{\left(2 \cdot z + y\right)} + y\right) + t\right) + y \cdot 5\]
  3. Simplified0.1

    \[\leadsto x \cdot \left(\left(\color{blue}{\mathsf{fma}\left(2, z, y\right)} + y\right) + t\right) + y \cdot 5\]
  4. Final simplification0.1

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

Reproduce

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