\frac{e^{x}}{e^{x} - 1}\frac{e^{x}}{x + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(0.16666666666666666 + x \cdot 0.041666666666666664\right)\right)}(FPCore (x) :precision binary64 (/ (exp x) (- (exp x) 1.0)))
(FPCore (x)
:precision binary64
(/
(exp x)
(+
x
(*
(* x x)
(+ 0.5 (* x (+ 0.16666666666666666 (* x 0.041666666666666664))))))))double code(double x) {
return exp(x) / (exp(x) - 1.0);
}
double code(double x) {
return exp(x) / (x + ((x * x) * (0.5 + (x * (0.16666666666666666 + (x * 0.041666666666666664))))));
}




























Bits error versus x
Results
| Original | 41.2 |
|---|---|
| Target | 40.8 |
| Herbie | 1.0 |
| Alternative 1 | |
|---|---|
| Error | 41.3 |
| Cost | 64832 |
| Alternative 2 | |
|---|---|
| Error | 41.2 |
| Cost | 45760 |
| Alternative 3 | |
|---|---|
| Error | 41.2 |
| Cost | 45632 |
| Alternative 4 | |
|---|---|
| Error | 41.3 |
| Cost | 32896 |
| Alternative 5 | |
|---|---|
| Error | 41.3 |
| Cost | 32704 |
| Alternative 6 | |
|---|---|
| Error | 41.3 |
| Cost | 32576 |
| Alternative 7 | |
|---|---|
| Error | 41.4 |
| Cost | 25920 |
| Alternative 8 | |
|---|---|
| Error | 41.2 |
| Cost | 19840 |
| Alternative 9 | |
|---|---|
| Error | 63.0 |
| Cost | 19520 |
| Alternative 10 | |
|---|---|
| Error | 41.2 |
| Cost | 13120 |
| Alternative 11 | |
|---|---|
| Error | 1.0 |
| Cost | 7232 |
| Alternative 12 | |
|---|---|
| Error | 1.2 |
| Cost | 6976 |
| Alternative 13 | |
|---|---|
| Error | 40.8 |
| Cost | 6784 |
| Alternative 14 | |
|---|---|
| Error | 1.7 |
| Cost | 6592 |
| Alternative 15 | |
|---|---|
| Error | 5.6 |
| Cost | 1088 |
| Alternative 16 | |
|---|---|
| Error | 42.8 |
| Cost | 1088 |
| Alternative 17 | |
|---|---|
| Error | 7.4 |
| Cost | 832 |
| Alternative 18 | |
|---|---|
| Error | 11.0 |
| Cost | 576 |
| Alternative 19 | |
|---|---|
| Error | 21.2 |
| Cost | 576 |
| Alternative 20 | |
|---|---|
| Error | 21.3 |
| Cost | 320 |
| Alternative 21 | |
|---|---|
| Error | 21.4 |
| Cost | 192 |
| Alternative 22 | |
|---|---|
| Error | 61.4 |
| Cost | 64 |
| Alternative 23 | |
|---|---|
| Error | 42.2 |
| Cost | 64 |
| Alternative 24 | |
|---|---|
| Error | 61.9 |
| Cost | 64 |

Initial program 41.2
Taylor expanded around 0 15.1
Simplified1.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2021042
(FPCore (x)
:name "expq2 (section 3.11)"
:precision binary64
:herbie-target
(/ 1.0 (- 1.0 (exp (- x))))
(/ (exp x) (- (exp x) 1.0)))