\left(\left(\left(e + d\right) + c\right) + b\right) + a
\mathsf{fma}\left(\sqrt{c}, \sqrt{c}, b + a\right) + \left(d + e\right)double f(double a, double b, double c, double d, double e) {
double r3536202 = e;
double r3536203 = d;
double r3536204 = r3536202 + r3536203;
double r3536205 = c;
double r3536206 = r3536204 + r3536205;
double r3536207 = b;
double r3536208 = r3536206 + r3536207;
double r3536209 = a;
double r3536210 = r3536208 + r3536209;
return r3536210;
}
double f(double a, double b, double c, double d, double e) {
double r3536211 = c;
double r3536212 = sqrt(r3536211);
double r3536213 = b;
double r3536214 = a;
double r3536215 = r3536213 + r3536214;
double r3536216 = fma(r3536212, r3536212, r3536215);
double r3536217 = d;
double r3536218 = e;
double r3536219 = r3536217 + r3536218;
double r3536220 = r3536216 + r3536219;
return r3536220;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d




Bits error versus e
| Original | 0.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 0.4
rmApplied associate-+l+0.3
rmApplied associate-+l+0.3
rmApplied add-sqr-sqrt0.3
Applied fma-def0.3
Final simplification0.3
herbie shell --seed 2019139 +o rules:numerics
(FPCore (a b c d e)
:name "Expression 1, p15"
:pre (<= 1 a 2 b 4 c 8 d 16 e 32)
:herbie-target
(+ (+ d (+ c (+ a b))) e)
(+ (+ (+ (+ e d) c) b) a))