\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 r249540 = d1;
double r249541 = 10.0;
double r249542 = r249540 * r249541;
double r249543 = d2;
double r249544 = r249540 * r249543;
double r249545 = r249542 + r249544;
double r249546 = 20.0;
double r249547 = r249540 * r249546;
double r249548 = r249545 + r249547;
return r249548;
}
double f(double d1, double d2) {
double r249549 = 30.0;
double r249550 = d1;
double r249551 = 1.0;
double r249552 = d2;
double r249553 = r249550 * r249552;
double r249554 = r249551 * r249553;
double r249555 = fma(r249549, r249550, r249554);
return r249555;
}




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)))