\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 r68175 = 1.0;
double r68176 = x;
double r68177 = r68175 - r68176;
double r68178 = log(r68177);
double r68179 = r68175 + r68176;
double r68180 = log(r68179);
double r68181 = r68178 / r68180;
return r68181;
}
double f(double x) {
double r68182 = 1.0;
double r68183 = log(r68182);
double r68184 = x;
double r68185 = 0.5;
double r68186 = 2.0;
double r68187 = pow(r68184, r68186);
double r68188 = pow(r68182, r68186);
double r68189 = r68187 / r68188;
double r68190 = r68185 * r68189;
double r68191 = fma(r68182, r68184, r68190);
double r68192 = r68183 - r68191;
double r68193 = -0.5;
double r68194 = fma(r68182, r68184, r68183);
double r68195 = fma(r68193, r68189, r68194);
double r68196 = r68192 / r68195;
double r68197 = 3.0;
double r68198 = pow(r68196, r68197);
double r68199 = cbrt(r68198);
return r68199;
}




Bits error versus x
| Original | 61.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 61.4
Taylor expanded around 0 60.5
Simplified60.5
Taylor expanded around 0 0.4
Simplified0.4
rmApplied add-cbrt-cube42.3
Applied add-cbrt-cube41.7
Applied cbrt-undiv41.7
Simplified0.4
Final simplification0.4
herbie shell --seed 2019323 +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))))