\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 r6341336 = 1.0;
double r6341337 = x;
double r6341338 = r6341336 - r6341337;
double r6341339 = log(r6341338);
double r6341340 = r6341336 + r6341337;
double r6341341 = log(r6341340);
double r6341342 = r6341339 / r6341341;
return r6341342;
}
double f(double x) {
double r6341343 = x;
double r6341344 = -r6341343;
double r6341345 = log1p(r6341344);
double r6341346 = log1p(r6341343);
double r6341347 = r6341345 / r6341346;
return r6341347;
}




Bits error versus x
Results
| 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 2019107 +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))))