\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}-1 + \left(\log \left(1 - {\left(x + {x}^{3} \cdot 0.08333333333333333\right)}^{3}\right) - \log \left(1 + \left(\left(x + {x}^{3} \cdot 0.08333333333333333\right) + \left(x + {x}^{3} \cdot 0.08333333333333333\right) \cdot \left(x + {x}^{3} \cdot 0.08333333333333333\right)\right)\right)\right)(FPCore (x) :precision binary64 (/ (log (- 1.0 x)) (log (+ 1.0 x))))
(FPCore (x)
:precision binary64
(+
-1.0
(-
(log (- 1.0 (pow (+ x (* (pow x 3.0) 0.08333333333333333)) 3.0)))
(log
(+
1.0
(+
(+ x (* (pow x 3.0) 0.08333333333333333))
(*
(+ x (* (pow x 3.0) 0.08333333333333333))
(+ x (* (pow x 3.0) 0.08333333333333333)))))))))double code(double x) {
return log(1.0 - x) / log(1.0 + x);
}
double code(double x) {
return -1.0 + (log(1.0 - pow((x + (pow(x, 3.0) * 0.08333333333333333)), 3.0)) - log(1.0 + ((x + (pow(x, 3.0) * 0.08333333333333333)) + ((x + (pow(x, 3.0) * 0.08333333333333333)) * (x + (pow(x, 3.0) * 0.08333333333333333))))));
}




Bits error versus x
Results
| Original | 61.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 61.3
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-log-exp_binary64_4580.3
Simplified0.3
Taylor expanded around 0 0.3
Simplified0.3
rmApplied flip3--_binary64_4230.3
Applied log-div_binary64_5060.3
Final simplification0.3
herbie shell --seed 2021044
(FPCore (x)
:name "qlog (example 3.10)"
:precision binary64
:pre (and (< -1.0 x) (< x 1.0))
:herbie-target
(- (+ (+ (+ 1.0 x) (/ (* x x) 2.0)) (* 0.4166666666666667 (pow x 3.0))))
(/ (log (- 1.0 x)) (log (+ 1.0 x))))