Average Error: 0.1 → 0.0
Time: 10.9s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(5, y, \left(2 \cdot \left(z + y\right) + t\right) \cdot x\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(5, y, \left(2 \cdot \left(z + y\right) + t\right) \cdot x\right)
double f(double x, double y, double z, double t) {
        double r141966 = x;
        double r141967 = y;
        double r141968 = z;
        double r141969 = r141967 + r141968;
        double r141970 = r141969 + r141968;
        double r141971 = r141970 + r141967;
        double r141972 = t;
        double r141973 = r141971 + r141972;
        double r141974 = r141966 * r141973;
        double r141975 = 5.0;
        double r141976 = r141967 * r141975;
        double r141977 = r141974 + r141976;
        return r141977;
}

double f(double x, double y, double z, double t) {
        double r141978 = 5.0;
        double r141979 = y;
        double r141980 = 2.0;
        double r141981 = z;
        double r141982 = r141981 + r141979;
        double r141983 = r141980 * r141982;
        double r141984 = t;
        double r141985 = r141983 + r141984;
        double r141986 = x;
        double r141987 = r141985 * r141986;
        double r141988 = fma(r141978, r141979, r141987);
        return r141988;
}

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. Using strategy rm
  3. Applied associate-+l+0.1

    \[\leadsto x \cdot \left(\left(\color{blue}{\left(y + \left(z + z\right)\right)} + y\right) + t\right) + y \cdot 5\]
  4. Using strategy rm
  5. Applied flip-+30.6

    \[\leadsto \color{blue}{\frac{\left(x \cdot \left(\left(\left(y + \left(z + z\right)\right) + y\right) + t\right)\right) \cdot \left(x \cdot \left(\left(\left(y + \left(z + z\right)\right) + y\right) + t\right)\right) - \left(y \cdot 5\right) \cdot \left(y \cdot 5\right)}{x \cdot \left(\left(\left(y + \left(z + z\right)\right) + y\right) + t\right) - y \cdot 5}}\]
  6. Simplified30.6

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(5, y, \left(2 \cdot \left(z + y\right) + t\right) \cdot x\right) \cdot \mathsf{fma}\left(x, 2 \cdot \left(z + y\right) + t, -y \cdot 5\right)}}{x \cdot \left(\left(\left(y + \left(z + z\right)\right) + y\right) + t\right) - y \cdot 5}\]
  7. Simplified30.6

    \[\leadsto \frac{\mathsf{fma}\left(5, y, \left(2 \cdot \left(z + y\right) + t\right) \cdot x\right) \cdot \mathsf{fma}\left(x, 2 \cdot \left(z + y\right) + t, -y \cdot 5\right)}{\color{blue}{\mathsf{fma}\left(x, 2 \cdot \left(z + y\right) + t, -y \cdot 5\right)}}\]
  8. Using strategy rm
  9. Applied associate-/l*0.0

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(5, y, \left(2 \cdot \left(z + y\right) + t\right) \cdot x\right)}{\frac{\mathsf{fma}\left(x, 2 \cdot \left(z + y\right) + t, -y \cdot 5\right)}{\mathsf{fma}\left(x, 2 \cdot \left(z + y\right) + t, -y \cdot 5\right)}}}\]
  10. Simplified0.0

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

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

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