a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, b + c, d \cdot a\right)double f(double a, double b, double c, double d) {
double r4841805 = a;
double r4841806 = b;
double r4841807 = c;
double r4841808 = r4841806 + r4841807;
double r4841809 = d;
double r4841810 = r4841808 + r4841809;
double r4841811 = r4841805 * r4841810;
return r4841811;
}
double f(double a, double b, double c, double d) {
double r4841812 = a;
double r4841813 = b;
double r4841814 = c;
double r4841815 = r4841813 + r4841814;
double r4841816 = d;
double r4841817 = r4841816 * r4841812;
double r4841818 = fma(r4841812, r4841815, r4841817);
return r4841818;
}




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 add-sqr-sqrt0.5
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019192 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789.0 a 98765.0) (<= 0.0 b 1.0) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))