\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\log \left(\frac{e^{\frac{\log 1}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}}}{e^{\frac{1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}}}\right)double f(double x) {
double r75129 = 1.0;
double r75130 = x;
double r75131 = r75129 - r75130;
double r75132 = log(r75131);
double r75133 = r75129 + r75130;
double r75134 = log(r75133);
double r75135 = r75132 / r75134;
return r75135;
}
double f(double x) {
double r75136 = 1.0;
double r75137 = log(r75136);
double r75138 = x;
double r75139 = r75136 * r75138;
double r75140 = r75139 + r75137;
double r75141 = 0.5;
double r75142 = 2.0;
double r75143 = pow(r75138, r75142);
double r75144 = pow(r75136, r75142);
double r75145 = r75143 / r75144;
double r75146 = r75141 * r75145;
double r75147 = r75140 - r75146;
double r75148 = r75137 / r75147;
double r75149 = exp(r75148);
double r75150 = r75139 + r75146;
double r75151 = r75150 / r75147;
double r75152 = exp(r75151);
double r75153 = r75149 / r75152;
double r75154 = log(r75153);
return r75154;
}




Bits error versus x
Results
| Original | 61.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 61.4
Taylor expanded around 0 60.6
Taylor expanded around 0 0.4
rmApplied add-log-exp0.4
rmApplied div-sub0.4
Applied exp-diff0.4
Final simplification0.4
herbie shell --seed 2020059
(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))))