\left(\left(\left(e + d\right) + c\right) + b\right) + a
\mathsf{log1p}\left(\mathsf{expm1}\left(e + \left(c + \left(\left(a + b\right) + d\right)\right)\right)\right)double f(double a, double b, double c, double d, double e) {
double r80124 = e;
double r80125 = d;
double r80126 = r80124 + r80125;
double r80127 = c;
double r80128 = r80126 + r80127;
double r80129 = b;
double r80130 = r80128 + r80129;
double r80131 = a;
double r80132 = r80130 + r80131;
return r80132;
}
double f(double a, double b, double c, double d, double e) {
double r80133 = e;
double r80134 = c;
double r80135 = a;
double r80136 = b;
double r80137 = r80135 + r80136;
double r80138 = d;
double r80139 = r80137 + r80138;
double r80140 = r80134 + r80139;
double r80141 = r80133 + r80140;
double r80142 = expm1(r80141);
double r80143 = log1p(r80142);
return r80143;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d




Bits error versus e
Results
| Original | 0.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.4
Simplified0.3
rmApplied log1p-expm1-u0.3
Simplified0.2
rmApplied associate-+r+0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019174 +o rules:numerics
(FPCore (a b c d e)
:name "Expression 1, p15"
:pre (<= 1.0 a 2.0 b 4.0 c 8.0 d 16.0 e 32.0)
:herbie-target
(+ (+ d (+ c (+ a b))) e)
(+ (+ (+ (+ e d) c) b) a))