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 r549345 = x;
double r549346 = y;
double r549347 = z;
double r549348 = r549346 + r549347;
double r549349 = r549345 * r549348;
double r549350 = 5.0;
double r549351 = r549347 * r549350;
double r549352 = r549349 + r549351;
return r549352;
}
double f(double x, double y, double z) {
double r549353 = x;
double r549354 = z;
double r549355 = 5.0;
double r549356 = y;
double r549357 = r549353 * r549356;
double r549358 = fma(r549355, r549354, r549357);
double r549359 = fma(r549353, r549354, r549358);
return r549359;
}




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