\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\frac{\left(\log 1 - \frac{\frac{{x}^{2}}{{1}^{2}}}{2}\right) - 1 \cdot x}{\log 1 - \left(\frac{\frac{{x}^{2}}{{1}^{2}}}{2} - 1 \cdot x\right)}double f(double x) {
double r116804 = 1.0;
double r116805 = x;
double r116806 = r116804 - r116805;
double r116807 = log(r116806);
double r116808 = r116804 + r116805;
double r116809 = log(r116808);
double r116810 = r116807 / r116809;
return r116810;
}
double f(double x) {
double r116811 = 1.0;
double r116812 = log(r116811);
double r116813 = x;
double r116814 = 2.0;
double r116815 = pow(r116813, r116814);
double r116816 = pow(r116811, r116814);
double r116817 = r116815 / r116816;
double r116818 = r116817 / r116814;
double r116819 = r116812 - r116818;
double r116820 = r116811 * r116813;
double r116821 = r116819 - r116820;
double r116822 = r116818 - r116820;
double r116823 = r116812 - r116822;
double r116824 = r116821 / r116823;
return r116824;
}




Bits error versus x
Results
| Original | 61.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 61.3
Taylor expanded around 0 60.4
Simplified60.4
Taylor expanded around 0 0.4
Simplified0.4
rmApplied clear-num0.4
rmApplied div-inv0.6
Applied associate-/r*0.5
Final simplification0.4
herbie shell --seed 2019303
(FPCore (x)
:name "qlog (example 3.10)"
:precision binary64
:pre (and (< -1 x) (< x 1))
:herbie-target
(- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 0.416666666666666685 (pow x 3))))
(/ (log (- 1 x)) (log (+ 1 x))))