1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -240248535.9542663097381591796875:\\
\;\;\;\;1 - \log \left(\left(1 + \frac{1}{y}\right) \cdot \frac{x}{y} - \frac{1}{y}\right)\\
\mathbf{elif}\;y \le 4261617509.646634578704833984375:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(1 + \frac{1}{y}\right) \cdot \frac{x}{y} - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r18480740 = 1.0;
double r18480741 = x;
double r18480742 = y;
double r18480743 = r18480741 - r18480742;
double r18480744 = r18480740 - r18480742;
double r18480745 = r18480743 / r18480744;
double r18480746 = r18480740 - r18480745;
double r18480747 = log(r18480746);
double r18480748 = r18480740 - r18480747;
return r18480748;
}
double f(double x, double y) {
double r18480749 = y;
double r18480750 = -240248535.9542663;
bool r18480751 = r18480749 <= r18480750;
double r18480752 = 1.0;
double r18480753 = 1.0;
double r18480754 = r18480752 / r18480749;
double r18480755 = r18480753 + r18480754;
double r18480756 = x;
double r18480757 = r18480756 / r18480749;
double r18480758 = r18480755 * r18480757;
double r18480759 = r18480758 - r18480754;
double r18480760 = log(r18480759);
double r18480761 = r18480752 - r18480760;
double r18480762 = 4261617509.6466346;
bool r18480763 = r18480749 <= r18480762;
double r18480764 = exp(r18480752);
double r18480765 = r18480756 - r18480749;
double r18480766 = r18480752 - r18480749;
double r18480767 = r18480765 / r18480766;
double r18480768 = r18480752 - r18480767;
double r18480769 = r18480764 / r18480768;
double r18480770 = log(r18480769);
double r18480771 = r18480763 ? r18480770 : r18480761;
double r18480772 = r18480751 ? r18480761 : r18480771;
return r18480772;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -240248535.9542663 or 4261617509.6466346 < y Initial program 47.0
Taylor expanded around inf 0.1
Simplified0.1
if -240248535.9542663 < y < 4261617509.6466346Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019170
(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))))))