a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(c, a, a \cdot \left(b + d\right)\right)double f(double a, double b, double c, double d) {
double r3590148 = a;
double r3590149 = b;
double r3590150 = c;
double r3590151 = r3590149 + r3590150;
double r3590152 = d;
double r3590153 = r3590151 + r3590152;
double r3590154 = r3590148 * r3590153;
return r3590154;
}
double f(double a, double b, double c, double d) {
double r3590155 = c;
double r3590156 = a;
double r3590157 = b;
double r3590158 = d;
double r3590159 = r3590157 + r3590158;
double r3590160 = r3590156 * r3590159;
double r3590161 = fma(r3590155, r3590156, r3590160);
return r3590161;
}




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
Applied associate-*r*0.5
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019172 +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)))