Average Error: 0.1 → 0.1
Time: 3.5s
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 r149286 = x;
        double r149287 = y;
        double r149288 = z;
        double r149289 = r149287 + r149288;
        double r149290 = r149289 + r149288;
        double r149291 = r149290 + r149287;
        double r149292 = t;
        double r149293 = r149291 + r149292;
        double r149294 = r149286 * r149293;
        double r149295 = 5.0;
        double r149296 = r149287 * r149295;
        double r149297 = r149294 + r149296;
        return r149297;
}

double f(double x, double y, double z, double t) {
        double r149298 = y;
        double r149299 = z;
        double r149300 = r149298 + r149299;
        double r149301 = x;
        double r149302 = r149301 + r149301;
        double r149303 = 5.0;
        double r149304 = t;
        double r149305 = r149304 * r149301;
        double r149306 = fma(r149303, r149298, r149305);
        double r149307 = fma(r149300, r149302, r149306);
        return r149307;
}

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