1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -102078540239.528106689453125 \lor \neg \left(y \le 24595131.31851343810558319091796875\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{1}{\frac{\sqrt{1 - \frac{x - y}{1 - y}}}{\sqrt{e^{1}}}}\right) + \log \left(\frac{\sqrt{e^{1}}}{\sqrt{1 - \frac{x - y}{1 - y}}}\right)\\
\end{array}double f(double x, double y) {
double r374957 = 1.0;
double r374958 = x;
double r374959 = y;
double r374960 = r374958 - r374959;
double r374961 = r374957 - r374959;
double r374962 = r374960 / r374961;
double r374963 = r374957 - r374962;
double r374964 = log(r374963);
double r374965 = r374957 - r374964;
return r374965;
}
double f(double x, double y) {
double r374966 = y;
double r374967 = -102078540239.5281;
bool r374968 = r374966 <= r374967;
double r374969 = 24595131.318513438;
bool r374970 = r374966 <= r374969;
double r374971 = !r374970;
bool r374972 = r374968 || r374971;
double r374973 = 1.0;
double r374974 = exp(r374973);
double r374975 = x;
double r374976 = 2.0;
double r374977 = pow(r374966, r374976);
double r374978 = r374975 / r374977;
double r374979 = 1.0;
double r374980 = r374979 / r374966;
double r374981 = r374978 - r374980;
double r374982 = r374973 * r374981;
double r374983 = r374975 / r374966;
double r374984 = r374982 + r374983;
double r374985 = r374974 / r374984;
double r374986 = log(r374985);
double r374987 = r374975 - r374966;
double r374988 = r374973 - r374966;
double r374989 = r374987 / r374988;
double r374990 = r374973 - r374989;
double r374991 = sqrt(r374990);
double r374992 = sqrt(r374974);
double r374993 = r374991 / r374992;
double r374994 = r374979 / r374993;
double r374995 = log(r374994);
double r374996 = r374992 / r374991;
double r374997 = log(r374996);
double r374998 = r374995 + r374997;
double r374999 = r374972 ? r374986 : r374998;
return r374999;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if y < -102078540239.5281 or 24595131.318513438 < y Initial program 46.7
rmApplied add-log-exp46.7
Applied diff-log46.7
Taylor expanded around inf 0.2
Simplified0.2
if -102078540239.5281 < y < 24595131.318513438Initial program 0.2
rmApplied add-log-exp0.2
Applied diff-log0.2
rmApplied add-sqr-sqrt0.2
Applied add-sqr-sqrt0.2
Applied times-frac0.2
Applied log-prod0.2
rmApplied clear-num0.2
Final simplification0.2
herbie shell --seed 2019298
(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))))))