double f(double x) {
double r7926265 = 1.0;
double r7926266 = x;
double r7926267 = r7926265 - r7926266;
double r7926268 = log(r7926267);
double r7926269 = r7926265 + r7926266;
double r7926270 = log(r7926269);
double r7926271 = r7926268 / r7926270;
return r7926271;
}
double f(double x) {
double r7926272 = x;
double r7926273 = -r7926272;
double r7926274 = log1p(r7926273);
double r7926275 = log1p(r7926272);
double r7926276 = r7926274 / r7926275;
double r7926277 = r7926276 * r7926276;
double r7926278 = 0.3333333333333333;
double r7926279 = pow(r7926277, r7926278);
double r7926280 = cbrt(r7926276);
double r7926281 = r7926279 * r7926280;
return r7926281;
}
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}{\left(\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)} \cdot \frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}



Bits error versus x
| Original | 61.1 |
|---|---|
| Target | 0.3 |
| Herbie | 0.0 |
Initial program 61.1
Simplified60.1
rmApplied sub-neg60.1
Applied log1p-def0.0
rmApplied add-cube-cbrt0.1
rmApplied pow1/363.6
Applied pow1/363.6
Applied pow-prod-down0.0
Final simplification0.0
herbie shell --seed 2019102 +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))))