\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\frac{\log 1 - \left(1 \cdot \left(x \cdot x\right) + \frac{1}{2} \cdot \frac{{x}^{4}}{1 \cdot 1}\right)}{1 \cdot x + \left(\log 1 - \frac{1}{2} \cdot \left(x \cdot \frac{x}{1 \cdot 1}\right)\right)} - 1double code(double x) {
return ((double) (((double) log(((double) (1.0 - x)))) / ((double) log(((double) (1.0 + x))))));
}
double code(double x) {
return ((double) (((double) (((double) (((double) log(1.0)) - ((double) (((double) (1.0 * ((double) (x * x)))) + ((double) (0.5 * ((double) (((double) pow(x, 4.0)) / ((double) (1.0 * 1.0)))))))))) / ((double) (((double) (1.0 * x)) + ((double) (((double) log(1.0)) - ((double) (0.5 * ((double) (x * ((double) (x / ((double) (1.0 * 1.0)))))))))))))) - 1.0));
}




Bits error versus x
Results
| Original | 61.2 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
Initial program 61.2
rmApplied flip--60.8
Applied log-div61.0
Applied div-sub61.0
Simplified61.0
Taylor expanded around 0 1.1
Simplified1.1
Taylor expanded around 0 0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2020179
(FPCore (x)
:name "qlog (example 3.10)"
:precision binary64
:pre (and (< -1.0 x) (< x 1.0))
:herbie-target
(neg (+ (+ (+ 1.0 x) (/ (* x x) 2.0)) (* 0.4166666666666667 (pow x 3.0))))
(/ (log (- 1.0 x)) (log (+ 1.0 x))))