x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(5, z, \mathsf{fma}\left(x, z, x \cdot y\right)\right)double f(double x, double y, double z) {
double r646711 = x;
double r646712 = y;
double r646713 = z;
double r646714 = r646712 + r646713;
double r646715 = r646711 * r646714;
double r646716 = 5.0;
double r646717 = r646713 * r646716;
double r646718 = r646715 + r646717;
return r646718;
}
double f(double x, double y, double z) {
double r646719 = 5.0;
double r646720 = z;
double r646721 = x;
double r646722 = y;
double r646723 = r646721 * r646722;
double r646724 = fma(r646721, r646720, r646723);
double r646725 = fma(r646719, r646720, r646724);
return r646725;
}




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
rmApplied pow10.1
Applied pow10.1
Applied pow-prod-down0.1
Simplified0.1
Taylor expanded around 0 0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2019362 +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)))