Average Error: 0.1 → 0.1
Time: 3.6s
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 r178017 = x;
        double r178018 = y;
        double r178019 = z;
        double r178020 = r178018 + r178019;
        double r178021 = r178020 + r178019;
        double r178022 = r178021 + r178018;
        double r178023 = t;
        double r178024 = r178022 + r178023;
        double r178025 = r178017 * r178024;
        double r178026 = 5.0;
        double r178027 = r178018 * r178026;
        double r178028 = r178025 + r178027;
        return r178028;
}

double f(double x, double y, double z, double t) {
        double r178029 = y;
        double r178030 = z;
        double r178031 = r178029 + r178030;
        double r178032 = x;
        double r178033 = r178032 + r178032;
        double r178034 = 5.0;
        double r178035 = t;
        double r178036 = r178035 * r178032;
        double r178037 = fma(r178034, r178029, r178036);
        double r178038 = fma(r178031, r178033, r178037);
        return r178038;
}

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