Average Error: 0.1 → 0.1
Time: 4.3s
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(5, y, t \cdot x\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(5, y, t \cdot x\right)\right)
double f(double x, double y, double z, double t) {
        double r150021 = x;
        double r150022 = y;
        double r150023 = z;
        double r150024 = r150022 + r150023;
        double r150025 = r150024 + r150023;
        double r150026 = r150025 + r150022;
        double r150027 = t;
        double r150028 = r150026 + r150027;
        double r150029 = r150021 * r150028;
        double r150030 = 5.0;
        double r150031 = r150022 * r150030;
        double r150032 = r150029 + r150031;
        return r150032;
}

double f(double x, double y, double z, double t) {
        double r150033 = y;
        double r150034 = z;
        double r150035 = r150033 + r150034;
        double r150036 = x;
        double r150037 = r150036 + r150036;
        double r150038 = 5.0;
        double r150039 = t;
        double r150040 = r150039 * r150036;
        double r150041 = fma(r150038, r150033, r150040);
        double r150042 = fma(r150035, r150037, r150041);
        return r150042;
}

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

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

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

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

Reproduce

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