Average Error: 0.1 → 0.1
Time: 18.5s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0\]
\[\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5.0 \cdot y\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5.0
\mathsf{fma}\left(\mathsf{fma}\left(z + y, 2, t\right), x, 5.0 \cdot y\right)
double f(double x, double y, double z, double t) {
        double r2794356 = x;
        double r2794357 = y;
        double r2794358 = z;
        double r2794359 = r2794357 + r2794358;
        double r2794360 = r2794359 + r2794358;
        double r2794361 = r2794360 + r2794357;
        double r2794362 = t;
        double r2794363 = r2794361 + r2794362;
        double r2794364 = r2794356 * r2794363;
        double r2794365 = 5.0;
        double r2794366 = r2794357 * r2794365;
        double r2794367 = r2794364 + r2794366;
        return r2794367;
}

double f(double x, double y, double z, double t) {
        double r2794368 = z;
        double r2794369 = y;
        double r2794370 = r2794368 + r2794369;
        double r2794371 = 2.0;
        double r2794372 = t;
        double r2794373 = fma(r2794370, r2794371, r2794372);
        double r2794374 = x;
        double r2794375 = 5.0;
        double r2794376 = r2794375 * r2794369;
        double r2794377 = fma(r2794373, r2794374, r2794376);
        return r2794377;
}

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.0\]
  2. Simplified0.1

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

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

Reproduce

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