x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(5, z, x \cdot y\right) + x \cdot zdouble f(double x, double y, double z) {
double r495427 = x;
double r495428 = y;
double r495429 = z;
double r495430 = r495428 + r495429;
double r495431 = r495427 * r495430;
double r495432 = 5.0;
double r495433 = r495429 * r495432;
double r495434 = r495431 + r495433;
return r495434;
}
double f(double x, double y, double z) {
double r495435 = 5.0;
double r495436 = z;
double r495437 = x;
double r495438 = y;
double r495439 = r495437 * r495438;
double r495440 = fma(r495435, r495436, r495439);
double r495441 = r495437 * r495436;
double r495442 = r495440 + r495441;
return r495442;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied associate-*l*0.1
Simplified0.1
rmApplied fma-udef0.1
Applied distribute-lft-in0.1
Applied associate-+l+0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020039 +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)))