\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\log \left(\frac{e^{\frac{\log 1}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}}}{e^{\frac{1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}}}\right)double f(double x) {
double r75963 = 1.0;
double r75964 = x;
double r75965 = r75963 - r75964;
double r75966 = log(r75965);
double r75967 = r75963 + r75964;
double r75968 = log(r75967);
double r75969 = r75966 / r75968;
return r75969;
}
double f(double x) {
double r75970 = 1.0;
double r75971 = log(r75970);
double r75972 = x;
double r75973 = r75970 * r75972;
double r75974 = r75973 + r75971;
double r75975 = 0.5;
double r75976 = 2.0;
double r75977 = pow(r75972, r75976);
double r75978 = pow(r75970, r75976);
double r75979 = r75977 / r75978;
double r75980 = r75975 * r75979;
double r75981 = r75974 - r75980;
double r75982 = r75971 / r75981;
double r75983 = exp(r75982);
double r75984 = r75973 + r75980;
double r75985 = r75984 / r75981;
double r75986 = exp(r75985);
double r75987 = r75983 / r75986;
double r75988 = log(r75987);
return r75988;
}




Bits error versus x
Results
| Original | 61.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
Initial program 61.3
Taylor expanded around 0 60.5
Taylor expanded around 0 0.5
rmApplied add-log-exp0.5
rmApplied div-sub0.5
Applied exp-diff0.5
Final simplification0.5
herbie shell --seed 2020045
(FPCore (x)
:name "qlog (example 3.10)"
:precision binary64
:pre (and (< -1 x) (< x 1))
:herbie-target
(- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 0.4166666666666667 (pow x 3))))
(/ (log (- 1 x)) (log (+ 1 x))))