\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 r113340 = 1.0;
double r113341 = x;
double r113342 = r113340 - r113341;
double r113343 = log(r113342);
double r113344 = r113340 + r113341;
double r113345 = log(r113344);
double r113346 = r113343 / r113345;
return r113346;
}
double f(double x) {
double r113347 = 1.0;
double r113348 = log(r113347);
double r113349 = x;
double r113350 = r113347 * r113349;
double r113351 = r113350 + r113348;
double r113352 = 0.5;
double r113353 = 2.0;
double r113354 = pow(r113349, r113353);
double r113355 = pow(r113347, r113353);
double r113356 = r113354 / r113355;
double r113357 = r113352 * r113356;
double r113358 = r113351 - r113357;
double r113359 = r113348 / r113358;
double r113360 = exp(r113359);
double r113361 = r113350 + r113357;
double r113362 = r113361 / r113358;
double r113363 = exp(r113362);
double r113364 = r113360 / r113363;
double r113365 = log(r113364);
return r113365;
}




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))))