\frac{\varepsilon \cdot \left(e^{\left(a + b\right) \cdot \varepsilon} - 1\right)}{\left(e^{a \cdot \varepsilon} - 1\right) \cdot \left(e^{b \cdot \varepsilon} - 1\right)}\frac{1}{b} + \frac{1}{a}(FPCore (a b eps) :precision binary64 (/ (* eps (- (exp (* (+ a b) eps)) 1.0)) (* (- (exp (* a eps)) 1.0) (- (exp (* b eps)) 1.0))))
(FPCore (a b eps) :precision binary64 (+ (/ 1.0 b) (/ 1.0 a)))
double code(double a, double b, double eps) {
return (eps * (exp((a + b) * eps) - 1.0)) / ((exp(a * eps) - 1.0) * (exp(b * eps) - 1.0));
}
double code(double a, double b, double eps) {
return (1.0 / b) + (1.0 / a);
}









Bits error versus a









Bits error versus b









Bits error versus eps
Results
| Original | 60.6 |
|---|---|
| Target | 14.7 |
| Herbie | 3.1 |
| Alternative 1 | |
|---|---|
| Error | 10.0 |
| Cost | 1097 |
| Alternative 2 | |
|---|---|
| Error | 18.3 |
| Cost | 520 |
| Alternative 3 | |
|---|---|
| Error | 33.0 |
| Cost | 192 |
| Alternative 4 | |
|---|---|
| Error | 61.0 |
| Cost | 64 |
| Alternative 5 | |
|---|---|
| Error | 61.9 |
| Cost | 64 |


Initial program 60.6
Taylor expanded around 0 56.8
Simplified56.6
Taylor expanded around 0 14.7
Taylor expanded around 0 3.1
Simplified3.1
rmApplied +-commutative_binary64_10313.1
Simplified3.1
Final simplification3.1
herbie shell --seed 2021040
(FPCore (a b eps)
:name "expq3 (problem 3.4.2)"
:precision binary64
:pre (and (< -1.0 eps) (< eps 1.0))
:herbie-target
(/ (+ a b) (* a b))
(/ (* eps (- (exp (* (+ a b) eps)) 1.0)) (* (- (exp (* a eps)) 1.0) (- (exp (* b eps)) 1.0))))