\left(a + b\right) \cdot \left(a + b\right)
\mathsf{fma}\left(a, a + b, b \cdot \left(a + b\right)\right)double f(double a, double b) {
double r110555 = a;
double r110556 = b;
double r110557 = r110555 + r110556;
double r110558 = r110557 * r110557;
return r110558;
}
double f(double a, double b) {
double r110559 = a;
double r110560 = b;
double r110561 = r110559 + r110560;
double r110562 = r110560 * r110561;
double r110563 = fma(r110559, r110561, r110562);
return r110563;
}




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 fma-def0.0
Final simplification0.0
herbie shell --seed 2020024 +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)))