x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(z, 5, x \cdot \left(y + z\right)\right)double f(double x, double y, double z) {
double r417739 = x;
double r417740 = y;
double r417741 = z;
double r417742 = r417740 + r417741;
double r417743 = r417739 * r417742;
double r417744 = 5.0;
double r417745 = r417741 * r417744;
double r417746 = r417743 + r417745;
return r417746;
}
double f(double x, double y, double z) {
double r417747 = z;
double r417748 = 5.0;
double r417749 = x;
double r417750 = y;
double r417751 = r417750 + r417747;
double r417752 = r417749 * r417751;
double r417753 = fma(r417747, r417748, r417752);
return r417753;
}




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
rmApplied add-sqr-sqrt32.0
rmApplied *-un-lft-identity32.0
Applied sqrt-prod32.0
Applied *-un-lft-identity32.0
Applied sqrt-prod32.0
Applied swap-sqr32.0
Simplified32.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019212 +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)))