Average Error: 0.1 → 0.1
Time: 15.2s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(y, 5, \mathsf{fma}\left(z + y, 2, t\right) \cdot x\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y, 5, \mathsf{fma}\left(z + y, 2, t\right) \cdot x\right)
double f(double x, double y, double z, double t) {
        double r131423 = x;
        double r131424 = y;
        double r131425 = z;
        double r131426 = r131424 + r131425;
        double r131427 = r131426 + r131425;
        double r131428 = r131427 + r131424;
        double r131429 = t;
        double r131430 = r131428 + r131429;
        double r131431 = r131423 * r131430;
        double r131432 = 5.0;
        double r131433 = r131424 * r131432;
        double r131434 = r131431 + r131433;
        return r131434;
}

double f(double x, double y, double z, double t) {
        double r131435 = y;
        double r131436 = 5.0;
        double r131437 = z;
        double r131438 = r131437 + r131435;
        double r131439 = 2.0;
        double r131440 = t;
        double r131441 = fma(r131438, r131439, r131440);
        double r131442 = x;
        double r131443 = r131441 * r131442;
        double r131444 = fma(r131435, r131436, r131443);
        return r131444;
}

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))