\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 r93916 = a;
double r93917 = b;
double r93918 = r93916 + r93917;
double r93919 = r93918 * r93918;
return r93919;
}
double f(double a, double b) {
double r93920 = a;
double r93921 = 2.0;
double r93922 = b;
double r93923 = r93920 * r93922;
double r93924 = pow(r93922, r93921);
double r93925 = fma(r93921, r93923, r93924);
double r93926 = fma(r93920, r93920, r93925);
return r93926;
}




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