x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(x, z, \mathsf{fma}\left(5, z, x \cdot y\right)\right)double f(double x, double y, double z) {
double r2391 = x;
double r2392 = y;
double r2393 = z;
double r2394 = r2392 + r2393;
double r2395 = r2391 * r2394;
double r2396 = 5.0;
double r2397 = r2393 * r2396;
double r2398 = r2395 + r2397;
return r2398;
}
double f(double x, double y, double z) {
double r2399 = x;
double r2400 = z;
double r2401 = 5.0;
double r2402 = y;
double r2403 = r2399 * r2402;
double r2404 = fma(r2401, r2400, r2403);
double r2405 = fma(r2399, r2400, r2404);
return r2405;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 0.1
Simplified0.1
Taylor expanded around 0 0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2020025 +o rules:numerics
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:precision binary64
:herbie-target
(+ (* (+ x 5) z) (* x y))
(+ (* x (+ y z)) (* z 5)))