Average Error: 0.1 → 0.1
Time: 2.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 r134275 = x;
        double r134276 = y;
        double r134277 = z;
        double r134278 = r134276 + r134277;
        double r134279 = r134278 + r134277;
        double r134280 = r134279 + r134276;
        double r134281 = t;
        double r134282 = r134280 + r134281;
        double r134283 = r134275 * r134282;
        double r134284 = 5.0;
        double r134285 = r134276 * r134284;
        double r134286 = r134283 + r134285;
        return r134286;
}

double f(double x, double y, double z, double t) {
        double r134287 = y;
        double r134288 = z;
        double r134289 = r134287 + r134288;
        double r134290 = x;
        double r134291 = r134290 + r134290;
        double r134292 = 5.0;
        double r134293 = t;
        double r134294 = r134293 * r134290;
        double r134295 = fma(r134292, r134287, r134294);
        double r134296 = fma(r134289, r134291, r134295);
        return r134296;
}

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