\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\frac{\frac{1}{\left(x \cdot 1 - \frac{\frac{x}{1} \cdot \frac{x}{1}}{2}\right) + \log 1}}{\frac{1}{\left(\log 1 - x \cdot 1\right) - \frac{\frac{x}{1} \cdot \frac{x}{1}}{2}}}double f(double x) {
double r3843435 = 1.0;
double r3843436 = x;
double r3843437 = r3843435 - r3843436;
double r3843438 = log(r3843437);
double r3843439 = r3843435 + r3843436;
double r3843440 = log(r3843439);
double r3843441 = r3843438 / r3843440;
return r3843441;
}
double f(double x) {
double r3843442 = 1.0;
double r3843443 = x;
double r3843444 = 1.0;
double r3843445 = r3843443 * r3843444;
double r3843446 = r3843443 / r3843444;
double r3843447 = r3843446 * r3843446;
double r3843448 = 2.0;
double r3843449 = r3843447 / r3843448;
double r3843450 = r3843445 - r3843449;
double r3843451 = log(r3843444);
double r3843452 = r3843450 + r3843451;
double r3843453 = r3843442 / r3843452;
double r3843454 = r3843451 - r3843445;
double r3843455 = r3843454 - r3843449;
double r3843456 = r3843442 / r3843455;
double r3843457 = r3843453 / r3843456;
return r3843457;
}




Bits error versus x
Results
| Original | 61.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 61.4
Taylor expanded around 0 60.5
Simplified60.5
Taylor expanded around 0 0.4
Simplified0.4
rmApplied clear-num0.4
Simplified0.4
rmApplied div-inv0.6
Applied associate-/r*0.4
Final simplification0.4
herbie shell --seed 2019171
(FPCore (x)
:name "qlog (example 3.10)"
: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))))