double code(double x) {
return ((double) (((double) exp(x)) / ((double) (((double) exp(x)) - 1.0))));
}
double code(double x) {
double VAR;
if ((x <= -0.0023147181705364885)) {
VAR = ((double) (1.0 / ((double) (1.0 - ((double) exp(((double) (((double) log(1.0)) - x))))))));
} else {
VAR = ((double) (0.5 + ((double) (((double) (x * 0.08333333333333333)) + ((double) (1.0 / x))))));
}
return VAR;
}




Bits error versus x
Results
| Original | 41.0 |
|---|---|
| Target | 40.6 |
| Herbie | 0.6 |
if x < -0.00231471817053648847Initial program 0.0
rmApplied clear-num0.0
Simplified0.0
rmApplied add-exp-log0.0
Applied div-exp0.0
if -0.00231471817053648847 < x Initial program 62.0
Taylor expanded around 0 0.9
Simplified0.9
Final simplification0.6
herbie shell --seed 2020181
(FPCore (x)
:name "expq2 (section 3.11)"
:precision binary64
:herbie-target
(/ 1.0 (- 1.0 (exp (neg x))))
(/ (exp x) (- (exp x) 1.0)))