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 r94105 = a;
double r94106 = b;
double r94107 = c;
double r94108 = r94106 + r94107;
double r94109 = d;
double r94110 = r94108 + r94109;
double r94111 = r94105 * r94110;
return r94111;
}
double f(double a, double b, double c, double d) {
double r94112 = d;
double r94113 = a;
double r94114 = b;
double r94115 = c;
double r94116 = r94113 * r94115;
double r94117 = fma(r94113, r94114, r94116);
double r94118 = fma(r94112, r94113, r94117);
return r94118;
}




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 pow10.0
Applied pow10.0
Applied pow-prod-down0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020049 +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)))