1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -119577009.99898484 \lor \neg \left(y \le 25589815.688386947\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\left(1 + \frac{1}{y}\right) \cdot \frac{x}{y} - \frac{1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \left(x - y\right) \cdot \frac{1}{1 - y}\right)\\
\end{array}double f(double x, double y) {
double r494737 = 1.0;
double r494738 = x;
double r494739 = y;
double r494740 = r494738 - r494739;
double r494741 = r494737 - r494739;
double r494742 = r494740 / r494741;
double r494743 = r494737 - r494742;
double r494744 = log(r494743);
double r494745 = r494737 - r494744;
return r494745;
}
double f(double x, double y) {
double r494746 = y;
double r494747 = -119577009.99898484;
bool r494748 = r494746 <= r494747;
double r494749 = 25589815.688386947;
bool r494750 = r494746 <= r494749;
double r494751 = !r494750;
bool r494752 = r494748 || r494751;
double r494753 = 1.0;
double r494754 = exp(r494753);
double r494755 = 1.0;
double r494756 = r494753 / r494746;
double r494757 = r494755 + r494756;
double r494758 = x;
double r494759 = r494758 / r494746;
double r494760 = r494757 * r494759;
double r494761 = r494760 - r494756;
double r494762 = r494754 / r494761;
double r494763 = log(r494762);
double r494764 = r494758 - r494746;
double r494765 = r494753 - r494746;
double r494766 = r494755 / r494765;
double r494767 = r494764 * r494766;
double r494768 = r494753 - r494767;
double r494769 = log(r494768);
double r494770 = r494753 - r494769;
double r494771 = r494752 ? r494763 : r494770;
return r494771;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -119577009.99898484 or 25589815.688386947 < y Initial program 46.9
rmApplied add-log-exp46.9
Applied diff-log46.9
Taylor expanded around inf 0.2
Simplified0.2
if -119577009.99898484 < y < 25589815.688386947Initial program 0.1
rmApplied div-inv0.1
Final simplification0.1
herbie shell --seed 2020046
(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))))))