\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}{a} + \frac{1}{b}(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 a) (/ 1.0 b)))
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 / a) + (1.0 / b);
}









Bits error versus a









Bits error versus b









Bits error versus eps
Results
| Original | 60.3 |
|---|---|
| Target | 14.8 |
| Herbie | 3.4 |
| Alternative 1 | |
|---|---|
| Error | 11.1 |
| Cost | 1411 |
| Alternative 2 | |
|---|---|
| Error | 19.0 |
| Cost | 785 |
| Alternative 3 | |
|---|---|
| Error | 33.1 |
| Cost | 192 |
| Alternative 4 | |
|---|---|
| Error | 60.9 |
| Cost | 64 |
| Alternative 5 | |
|---|---|
| Error | 61.9 |
| Cost | 64 |


Initial program 60.3
Taylor expanded around 0 62.2
Simplified62.2
Taylor expanded around 0 14.8
Taylor expanded around 0 3.4
Simplified3.4
rmApplied *-un-lft-identity_binary64_7603.4
Applied add-sqr-sqrt_binary64_7823.4
Applied times-frac_binary64_7663.4
Applied *-un-lft-identity_binary64_7603.4
Applied add-sqr-sqrt_binary64_7823.4
Applied times-frac_binary64_7663.4
Applied distribute-lft-out_binary64_7113.4
Simplified3.4
Simplified3.4
Final simplification3.4
herbie shell --seed 2021045
(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))))