Average Error: 0.1 → 0.1
Time: 4.4s
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 r143553 = x;
        double r143554 = y;
        double r143555 = z;
        double r143556 = r143554 + r143555;
        double r143557 = r143556 + r143555;
        double r143558 = r143557 + r143554;
        double r143559 = t;
        double r143560 = r143558 + r143559;
        double r143561 = r143553 * r143560;
        double r143562 = 5.0;
        double r143563 = r143554 * r143562;
        double r143564 = r143561 + r143563;
        return r143564;
}

double f(double x, double y, double z, double t) {
        double r143565 = y;
        double r143566 = z;
        double r143567 = r143565 + r143566;
        double r143568 = x;
        double r143569 = r143568 + r143568;
        double r143570 = 5.0;
        double r143571 = t;
        double r143572 = r143571 * r143568;
        double r143573 = fma(r143570, r143565, r143572);
        double r143574 = fma(r143567, r143569, r143573);
        return r143574;
}

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