\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 r96528 = a;
double r96529 = b;
double r96530 = r96528 + r96529;
double r96531 = r96530 * r96530;
return r96531;
}
double f(double a, double b) {
double r96532 = a;
double r96533 = 2.0;
double r96534 = b;
double r96535 = r96532 * r96534;
double r96536 = pow(r96534, r96533);
double r96537 = fma(r96533, r96535, r96536);
double r96538 = fma(r96532, r96532, r96537);
return r96538;
}




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