Average Error: 0.1 → 0.1
Time: 24.3s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(x, \left(\left(\left(y + z\right) + z\right) + y\right) + t, 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, \left(\left(\left(y + z\right) + z\right) + y\right) + t, y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r101290 = x;
        double r101291 = y;
        double r101292 = z;
        double r101293 = r101291 + r101292;
        double r101294 = r101293 + r101292;
        double r101295 = r101294 + r101291;
        double r101296 = t;
        double r101297 = r101295 + r101296;
        double r101298 = r101290 * r101297;
        double r101299 = 5.0;
        double r101300 = r101291 * r101299;
        double r101301 = r101298 + r101300;
        return r101301;
}

double f(double x, double y, double z, double t) {
        double r101302 = x;
        double r101303 = y;
        double r101304 = z;
        double r101305 = r101303 + r101304;
        double r101306 = r101305 + r101304;
        double r101307 = r101306 + r101303;
        double r101308 = t;
        double r101309 = r101307 + r101308;
        double r101310 = 5.0;
        double r101311 = r101303 * r101310;
        double r101312 = fma(r101302, r101309, r101311);
        return r101312;
}

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. Using strategy rm
  3. Applied fma-def0.1

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

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

Reproduce

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