Average Error: 0.1 → 0.1
Time: 3.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 r139235 = x;
        double r139236 = y;
        double r139237 = z;
        double r139238 = r139236 + r139237;
        double r139239 = r139238 + r139237;
        double r139240 = r139239 + r139236;
        double r139241 = t;
        double r139242 = r139240 + r139241;
        double r139243 = r139235 * r139242;
        double r139244 = 5.0;
        double r139245 = r139236 * r139244;
        double r139246 = r139243 + r139245;
        return r139246;
}

double f(double x, double y, double z, double t) {
        double r139247 = y;
        double r139248 = z;
        double r139249 = r139247 + r139248;
        double r139250 = x;
        double r139251 = r139250 + r139250;
        double r139252 = 5.0;
        double r139253 = t;
        double r139254 = r139253 * r139250;
        double r139255 = fma(r139252, r139247, r139254);
        double r139256 = fma(r139249, r139251, r139255);
        return r139256;
}

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