x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(5, z, \left(z + y\right) \cdot x\right)double f(double x, double y, double z) {
double r364905 = x;
double r364906 = y;
double r364907 = z;
double r364908 = r364906 + r364907;
double r364909 = r364905 * r364908;
double r364910 = 5.0;
double r364911 = r364907 * r364910;
double r364912 = r364909 + r364911;
return r364912;
}
double f(double x, double y, double z) {
double r364913 = 5.0;
double r364914 = z;
double r364915 = y;
double r364916 = r364914 + r364915;
double r364917 = x;
double r364918 = r364916 * r364917;
double r364919 = fma(r364913, r364914, r364918);
return r364919;
}




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
Taylor expanded around 0 0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:herbie-target
(+ (* (+ x 5.0) z) (* x y))
(+ (* x (+ y z)) (* z 5.0)))