\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 r106667 = a;
double r106668 = b;
double r106669 = r106667 + r106668;
double r106670 = r106669 * r106669;
return r106670;
}
double f(double a, double b) {
double r106671 = a;
double r106672 = 2.0;
double r106673 = b;
double r106674 = r106671 * r106673;
double r106675 = pow(r106673, r106672);
double r106676 = fma(r106672, r106674, r106675);
double r106677 = fma(r106671, r106671, r106676);
return r106677;
}




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