x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(z, 5, x \cdot y + z \cdot x\right)double f(double x, double y, double z) {
double r358190 = x;
double r358191 = y;
double r358192 = z;
double r358193 = r358191 + r358192;
double r358194 = r358190 * r358193;
double r358195 = 5.0;
double r358196 = r358192 * r358195;
double r358197 = r358194 + r358196;
return r358197;
}
double f(double x, double y, double z) {
double r358198 = z;
double r358199 = 5.0;
double r358200 = x;
double r358201 = y;
double r358202 = r358200 * r358201;
double r358203 = r358198 * r358200;
double r358204 = r358202 + r358203;
double r358205 = fma(r358198, r358199, r358204);
return r358205;
}




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.3
Taylor expanded around 0 0.1
Simplified0.0
rmApplied distribute-lft-in0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019235 +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)))