1.0 - \log \left(1.0 - \frac{x - y}{1.0 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1.0 - y} \le 0.8581617207853955:\\
\;\;\;\;\log \left(\frac{\sqrt{e^{1.0}}}{1.0 - \frac{x - y}{1.0 - y}} \cdot \sqrt{e^{1.0}}\right)\\
\mathbf{else}:\\
\;\;\;\;1.0 - \log \left(\left(\frac{1.0}{y} \cdot \frac{x}{y} + \frac{x}{y}\right) - \frac{1.0}{y}\right)\\
\end{array}double f(double x, double y) {
double r16638977 = 1.0;
double r16638978 = x;
double r16638979 = y;
double r16638980 = r16638978 - r16638979;
double r16638981 = r16638977 - r16638979;
double r16638982 = r16638980 / r16638981;
double r16638983 = r16638977 - r16638982;
double r16638984 = log(r16638983);
double r16638985 = r16638977 - r16638984;
return r16638985;
}
double f(double x, double y) {
double r16638986 = x;
double r16638987 = y;
double r16638988 = r16638986 - r16638987;
double r16638989 = 1.0;
double r16638990 = r16638989 - r16638987;
double r16638991 = r16638988 / r16638990;
double r16638992 = 0.8581617207853955;
bool r16638993 = r16638991 <= r16638992;
double r16638994 = exp(r16638989);
double r16638995 = sqrt(r16638994);
double r16638996 = r16638989 - r16638991;
double r16638997 = r16638995 / r16638996;
double r16638998 = r16638997 * r16638995;
double r16638999 = log(r16638998);
double r16639000 = r16638989 / r16638987;
double r16639001 = r16638986 / r16638987;
double r16639002 = r16639000 * r16639001;
double r16639003 = r16639002 + r16639001;
double r16639004 = r16639003 - r16639000;
double r16639005 = log(r16639004);
double r16639006 = r16638989 - r16639005;
double r16639007 = r16638993 ? r16638999 : r16639006;
return r16639007;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.8581617207853955Initial program 0.0
rmApplied add-log-exp0.0
Applied diff-log0.0
rmApplied *-un-lft-identity0.0
Applied add-sqr-sqrt0.0
Applied times-frac0.0
Simplified0.0
if 0.8581617207853955 < (/ (- x y) (- 1.0 y)) Initial program 59.3
Taylor expanded around inf 0.7
Simplified0.7
Final simplification0.2
herbie shell --seed 2019163
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))