a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, \left(b + c\right), \left(d \cdot a\right)\right)double f(double a, double b, double c, double d) {
double r2731325 = a;
double r2731326 = b;
double r2731327 = c;
double r2731328 = r2731326 + r2731327;
double r2731329 = d;
double r2731330 = r2731328 + r2731329;
double r2731331 = r2731325 * r2731330;
return r2731331;
}
double f(double a, double b, double c, double d) {
double r2731332 = a;
double r2731333 = b;
double r2731334 = c;
double r2731335 = r2731333 + r2731334;
double r2731336 = d;
double r2731337 = r2731336 * r2731332;
double r2731338 = fma(r2731332, r2731335, r2731337);
return r2731338;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied distribute-lft-in0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019129 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789 a 98765) (<= 0 b 1) (<= 0 c 0.0016773) (<= 0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))