1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le \frac{-7757395642503235}{33554432} \lor \neg \left(y \le \frac{226964482154373}{33554432}\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r259167 = 1.0;
double r259168 = x;
double r259169 = y;
double r259170 = r259168 - r259169;
double r259171 = r259167 - r259169;
double r259172 = r259170 / r259171;
double r259173 = r259167 - r259172;
double r259174 = log(r259173);
double r259175 = r259167 - r259174;
return r259175;
}
double f(double x, double y) {
double r259176 = y;
double r259177 = -7757395642503235.0;
double r259178 = 33554432.0;
double r259179 = r259177 / r259178;
bool r259180 = r259176 <= r259179;
double r259181 = 226964482154373.0;
double r259182 = r259181 / r259178;
bool r259183 = r259176 <= r259182;
double r259184 = !r259183;
bool r259185 = r259180 || r259184;
double r259186 = 1.0;
double r259187 = x;
double r259188 = 2.0;
double r259189 = pow(r259176, r259188);
double r259190 = r259187 / r259189;
double r259191 = 1.0;
double r259192 = r259191 / r259176;
double r259193 = r259190 - r259192;
double r259194 = r259186 * r259193;
double r259195 = r259187 / r259176;
double r259196 = r259194 + r259195;
double r259197 = log(r259196);
double r259198 = r259186 - r259197;
double r259199 = exp(r259186);
double r259200 = r259187 - r259176;
double r259201 = r259186 - r259176;
double r259202 = r259200 / r259201;
double r259203 = r259186 - r259202;
double r259204 = r259199 / r259203;
double r259205 = log(r259204);
double r259206 = r259185 ? r259198 : r259205;
return r259206;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -231188405.82678422 or 6764068.667720944 < y Initial program 47.1
Taylor expanded around inf 0.1
Simplified0.1
if -231188405.82678422 < y < 6764068.667720944Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019304
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.619472414) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))