Average Error: 0.1 → 0.0
Time: 3.9s
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 r127512 = x;
        double r127513 = y;
        double r127514 = z;
        double r127515 = r127513 + r127514;
        double r127516 = r127515 + r127514;
        double r127517 = r127516 + r127513;
        double r127518 = t;
        double r127519 = r127517 + r127518;
        double r127520 = r127512 * r127519;
        double r127521 = 5.0;
        double r127522 = r127513 * r127521;
        double r127523 = r127520 + r127522;
        return r127523;
}

double f(double x, double y, double z, double t) {
        double r127524 = y;
        double r127525 = z;
        double r127526 = r127524 + r127525;
        double r127527 = x;
        double r127528 = r127527 + r127527;
        double r127529 = 5.0;
        double r127530 = t;
        double r127531 = r127530 * r127527;
        double r127532 = fma(r127529, r127524, r127531);
        double r127533 = fma(r127526, r127528, r127532);
        return r127533;
}

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.0

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

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

Reproduce

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