\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 r58007 = e;
double r58008 = d;
double r58009 = r58007 + r58008;
double r58010 = c;
double r58011 = r58009 + r58010;
double r58012 = b;
double r58013 = r58011 + r58012;
double r58014 = a;
double r58015 = r58013 + r58014;
return r58015;
}
double f(double a, double b, double c, double d, double e) {
double r58016 = e;
double r58017 = c;
double r58018 = a;
double r58019 = b;
double r58020 = r58018 + r58019;
double r58021 = d;
double r58022 = r58020 + r58021;
double r58023 = r58017 + r58022;
double r58024 = r58016 + r58023;
double r58025 = expm1(r58024);
double r58026 = log1p(r58025);
return r58026;
}




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 2019194 +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))