double f(double x) {
double r4992631 = 1.0;
double r4992632 = x;
double r4992633 = r4992631 - r4992632;
double r4992634 = log(r4992633);
double r4992635 = r4992631 + r4992632;
double r4992636 = log(r4992635);
double r4992637 = r4992634 / r4992636;
return r4992637;
}
double f(double x) {
double r4992638 = x;
double r4992639 = -r4992638;
double r4992640 = log1p(r4992639);
double r4992641 = log1p(r4992638);
double r4992642 = r4992640 / r4992641;
return r4992642;
}
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}



Bits error versus x
| Original | 60.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.0 |
Initial program 60.9
Simplified60.0
rmApplied sub-neg60.0
Applied log1p-def0.0
Final simplification0.0
herbie shell --seed 2019101 +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))))