\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 r9639308 = 1.0;
double r9639309 = x;
double r9639310 = r9639308 - r9639309;
double r9639311 = log(r9639310);
double r9639312 = r9639308 + r9639309;
double r9639313 = log(r9639312);
double r9639314 = r9639311 / r9639313;
return r9639314;
}
double f(double x) {
double r9639315 = x;
double r9639316 = -r9639315;
double r9639317 = log1p(r9639316);
double r9639318 = log1p(r9639315);
double r9639319 = r9639317 / r9639318;
return r9639319;
}




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