\left(a + b\right) \cdot \left(a + b\right)
{a}^{2} + \left(2 \cdot \left(a \cdot b\right) + {b}^{2}\right)double f(double a, double b) {
double r88628 = a;
double r88629 = b;
double r88630 = r88628 + r88629;
double r88631 = r88630 * r88630;
return r88631;
}
double f(double a, double b) {
double r88632 = a;
double r88633 = 2.0;
double r88634 = pow(r88632, r88633);
double r88635 = b;
double r88636 = r88632 * r88635;
double r88637 = r88633 * r88636;
double r88638 = pow(r88635, r88633);
double r88639 = r88637 + r88638;
double r88640 = r88634 + r88639;
return r88640;
}




Bits error versus a




Bits error versus b
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied distribute-rgt-in0.0
Taylor expanded around 0 0.0
Final simplification0.0
herbie shell --seed 2019291
(FPCore (a b)
:name "Expression 4, p15"
:precision binary64
:pre (and (<= 5 a 10) (<= 0.0 b 1e-3))
:herbie-target
(+ (+ (+ (* b a) (* b b)) (* b a)) (* a a))
(* (+ a b) (+ a b)))