\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20
\mathsf{fma}\left(30, d1, 1 \cdot \left(d1 \cdot d2\right)\right)double f(double d1, double d2) {
double r288252 = d1;
double r288253 = 10.0;
double r288254 = r288252 * r288253;
double r288255 = d2;
double r288256 = r288252 * r288255;
double r288257 = r288254 + r288256;
double r288258 = 20.0;
double r288259 = r288252 * r288258;
double r288260 = r288257 + r288259;
return r288260;
}
double f(double d1, double d2) {
double r288261 = 30.0;
double r288262 = d1;
double r288263 = 1.0;
double r288264 = d2;
double r288265 = r288262 * r288264;
double r288266 = r288263 * r288265;
double r288267 = fma(r288261, r288262, r288266);
return r288267;
}




Bits error versus d1




Bits error versus d2
| Original | 0.2 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.2
Simplified0.0
rmApplied flip-+11.9
Applied associate-*r/14.4
Taylor expanded around 0 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020047 +o rules:numerics
(FPCore (d1 d2)
:name "FastMath test2"
:precision binary64
:herbie-target
(* d1 (+ 30 d2))
(+ (+ (* d1 10) (* d1 d2)) (* d1 20)))