\left(a + b\right) \cdot \left(a + b\right)
\mathsf{fma}\left(a, a, \mathsf{fma}\left(2, a \cdot b, {b}^{2}\right)\right)double f(double a, double b) {
double r58414 = a;
double r58415 = b;
double r58416 = r58414 + r58415;
double r58417 = r58416 * r58416;
return r58417;
}
double f(double a, double b) {
double r58418 = a;
double r58419 = 2.0;
double r58420 = b;
double r58421 = r58418 * r58420;
double r58422 = pow(r58420, r58419);
double r58423 = fma(r58419, r58421, r58422);
double r58424 = fma(r58418, r58418, r58423);
return r58424;
}




Bits error versus a




Bits error versus b
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0 |
Initial program 0.0
rmApplied flip-+0.0
Applied flip3-+0.3
Applied frac-times0.3
Simplified0.3
Simplified0.3
Taylor expanded around 0 0.0
Simplified0
Final simplification0
herbie shell --seed 2020035 +o rules:numerics
(FPCore (a b)
:name "Expression 4, p15"
:precision binary64
:pre (and (<= 5 a 10) (<= 0.0 b 0.001))
:herbie-target
(+ (+ (+ (* b a) (* b b)) (* b a)) (* a a))
(* (+ a b) (+ a b)))