1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.9999999132201147222787085411255247890949:\\
\;\;\;\;1 - \left(\log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right) + \log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\end{array}double f(double x, double y) {
double r350909 = 1.0;
double r350910 = x;
double r350911 = y;
double r350912 = r350910 - r350911;
double r350913 = r350909 - r350911;
double r350914 = r350912 / r350913;
double r350915 = r350909 - r350914;
double r350916 = log(r350915);
double r350917 = r350909 - r350916;
return r350917;
}
double f(double x, double y) {
double r350918 = x;
double r350919 = y;
double r350920 = r350918 - r350919;
double r350921 = 1.0;
double r350922 = r350921 - r350919;
double r350923 = r350920 / r350922;
double r350924 = 0.9999999132201147;
bool r350925 = r350923 <= r350924;
double r350926 = r350921 - r350923;
double r350927 = sqrt(r350926);
double r350928 = log(r350927);
double r350929 = r350928 + r350928;
double r350930 = r350921 - r350929;
double r350931 = 2.0;
double r350932 = pow(r350919, r350931);
double r350933 = r350918 / r350932;
double r350934 = 1.0;
double r350935 = r350934 / r350919;
double r350936 = r350933 - r350935;
double r350937 = r350921 * r350936;
double r350938 = r350918 / r350919;
double r350939 = r350937 + r350938;
double r350940 = log(r350939);
double r350941 = r350921 - r350940;
double r350942 = r350925 ? r350930 : r350941;
return r350942;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if (/ (- x y) (- 1.0 y)) < 0.9999999132201147Initial program 0.1
rmApplied add-sqr-sqrt0.1
Applied log-prod0.1
if 0.9999999132201147 < (/ (- x y) (- 1.0 y)) Initial program 62.9
Taylor expanded around inf 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019356
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.61947241) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))