\left(a + b\right) \cdot \left(a + b\right)
\mathsf{fma}\left(\sqrt{{a}^{2}}, \sqrt{{a}^{2}}, a \cdot b\right) + b \cdot \left(a + b\right)double f(double a, double b) {
double r85389 = a;
double r85390 = b;
double r85391 = r85389 + r85390;
double r85392 = r85391 * r85391;
return r85392;
}
double f(double a, double b) {
double r85393 = a;
double r85394 = 2.0;
double r85395 = pow(r85393, r85394);
double r85396 = sqrt(r85395);
double r85397 = b;
double r85398 = r85393 * r85397;
double r85399 = fma(r85396, r85396, r85398);
double r85400 = r85393 + r85397;
double r85401 = r85397 * r85400;
double r85402 = r85399 + r85401;
return r85402;
}




Bits error versus a




Bits error versus b
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied distribute-lft-in0.0
Simplified0.0
Simplified0.0
rmApplied distribute-lft-in0.0
Simplified0.0
rmApplied add-sqr-sqrt0.0
Applied fma-def0.0
Final simplification0.0
herbie shell --seed 2020060 +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)))