\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 r98840 = a;
double r98841 = b;
double r98842 = r98840 + r98841;
double r98843 = r98842 * r98842;
return r98843;
}
double f(double a, double b) {
double r98844 = a;
double r98845 = 2.0;
double r98846 = pow(r98844, r98845);
double r98847 = sqrt(r98846);
double r98848 = b;
double r98849 = r98844 * r98848;
double r98850 = fma(r98847, r98847, r98849);
double r98851 = r98844 + r98848;
double r98852 = r98848 * r98851;
double r98853 = r98850 + r98852;
return r98853;
}




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