a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(d, a, \mathsf{fma}\left(a, b, a \cdot c\right)\right)double f(double a, double b, double c, double d) {
double r75850 = a;
double r75851 = b;
double r75852 = c;
double r75853 = r75851 + r75852;
double r75854 = d;
double r75855 = r75853 + r75854;
double r75856 = r75850 * r75855;
return r75856;
}
double f(double a, double b, double c, double d) {
double r75857 = d;
double r75858 = a;
double r75859 = b;
double r75860 = c;
double r75861 = r75858 * r75860;
double r75862 = fma(r75858, r75859, r75861);
double r75863 = fma(r75857, r75858, r75862);
return r75863;
}




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
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020083 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:precision binary64
:pre (and (<= 56789 a 98765) (<= 0.0 b 1) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))