\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\sqrt[3]{{\left(\frac{\log 1 - \mathsf{fma}\left(1, x, \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\mathsf{fma}\left(\frac{-1}{2}, \frac{{x}^{2}}{{1}^{2}}, \mathsf{fma}\left(1, x, \log 1\right)\right)}\right)}^{3}}double f(double x) {
double r71606 = 1.0;
double r71607 = x;
double r71608 = r71606 - r71607;
double r71609 = log(r71608);
double r71610 = r71606 + r71607;
double r71611 = log(r71610);
double r71612 = r71609 / r71611;
return r71612;
}
double f(double x) {
double r71613 = 1.0;
double r71614 = log(r71613);
double r71615 = x;
double r71616 = 0.5;
double r71617 = 2.0;
double r71618 = pow(r71615, r71617);
double r71619 = pow(r71613, r71617);
double r71620 = r71618 / r71619;
double r71621 = r71616 * r71620;
double r71622 = fma(r71613, r71615, r71621);
double r71623 = r71614 - r71622;
double r71624 = -0.5;
double r71625 = fma(r71613, r71615, r71614);
double r71626 = fma(r71624, r71620, r71625);
double r71627 = r71623 / r71626;
double r71628 = 3.0;
double r71629 = pow(r71627, r71628);
double r71630 = cbrt(r71629);
return r71630;
}




Bits error versus x
| Original | 61.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 61.3
Taylor expanded around 0 60.4
Simplified60.4
Taylor expanded around 0 0.4
Simplified0.4
rmApplied add-cbrt-cube42.3
Applied add-cbrt-cube41.8
Applied cbrt-undiv41.8
Simplified0.4
Final simplification0.4
herbie shell --seed 2019347 +o rules:numerics
(FPCore (x)
:name "qlog (example 3.10)"
:precision binary64
:pre (and (< -1 x) (< x 1))
:herbie-target
(- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 0.4166666666666667 (pow x 3))))
(/ (log (- 1 x)) (log (+ 1 x))))