\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}double f(double x) {
double r4993432 = 1.0;
double r4993433 = x;
double r4993434 = r4993432 - r4993433;
double r4993435 = log(r4993434);
double r4993436 = r4993432 + r4993433;
double r4993437 = log(r4993436);
double r4993438 = r4993435 / r4993437;
return r4993438;
}
double f(double x) {
double r4993439 = x;
double r4993440 = -r4993439;
double r4993441 = log1p(r4993440);
double r4993442 = log1p(r4993439);
double r4993443 = r4993441 / r4993442;
return r4993443;
}




Bits error versus x
Results
| Original | 61.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.0 |
Initial program 61.0
Simplified60.0
rmApplied sub-neg60.0
Applied log1p-def0.0
Final simplification0.0
herbie shell --seed 2019119 +o rules:numerics
(FPCore (x)
:name "qlog (example 3.10)"
:pre (and (< -1 x) (< x 1))
:herbie-target
(- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 5/12 (pow x 3))))
(/ (log (- 1 x)) (log (+ 1 x))))