Average Error: 0.1 → 0.1
Time: 21.6s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r100481 = x;
        double r100482 = y;
        double r100483 = z;
        double r100484 = r100482 + r100483;
        double r100485 = r100484 + r100483;
        double r100486 = r100485 + r100482;
        double r100487 = t;
        double r100488 = r100486 + r100487;
        double r100489 = r100481 * r100488;
        double r100490 = 5.0;
        double r100491 = r100482 * r100490;
        double r100492 = r100489 + r100491;
        return r100492;
}

double f(double x, double y, double z, double t) {
        double r100493 = x;
        double r100494 = 2.0;
        double r100495 = y;
        double r100496 = z;
        double r100497 = r100495 + r100496;
        double r100498 = t;
        double r100499 = fma(r100494, r100497, r100498);
        double r100500 = 5.0;
        double r100501 = r100495 * r100500;
        double r100502 = fma(r100493, r100499, r100501);
        return r100502;
}

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(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)}\]
  3. Final simplification0.1

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

Reproduce

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