1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -173788009.49411574 \lor \neg \left(y \le 98105251.590079397\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{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r430735 = 1.0;
double r430736 = x;
double r430737 = y;
double r430738 = r430736 - r430737;
double r430739 = r430735 - r430737;
double r430740 = r430738 / r430739;
double r430741 = r430735 - r430740;
double r430742 = log(r430741);
double r430743 = r430735 - r430742;
return r430743;
}
double f(double x, double y) {
double r430744 = y;
double r430745 = -173788009.49411574;
bool r430746 = r430744 <= r430745;
double r430747 = 98105251.5900794;
bool r430748 = r430744 <= r430747;
double r430749 = !r430748;
bool r430750 = r430746 || r430749;
double r430751 = 1.0;
double r430752 = exp(r430751);
double r430753 = x;
double r430754 = 2.0;
double r430755 = pow(r430744, r430754);
double r430756 = r430753 / r430755;
double r430757 = 1.0;
double r430758 = r430757 / r430744;
double r430759 = r430756 - r430758;
double r430760 = r430751 * r430759;
double r430761 = r430753 / r430744;
double r430762 = r430760 + r430761;
double r430763 = r430752 / r430762;
double r430764 = log(r430763);
double r430765 = r430753 - r430744;
double r430766 = r430751 - r430744;
double r430767 = r430765 / r430766;
double r430768 = r430751 - r430767;
double r430769 = r430752 / r430768;
double r430770 = log(r430769);
double r430771 = r430750 ? r430764 : r430770;
return r430771;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -173788009.49411574 or 98105251.5900794 < y Initial program 47.1
rmApplied add-log-exp47.1
Applied diff-log47.1
Taylor expanded around inf 0.1
Simplified0.1
if -173788009.49411574 < y < 98105251.5900794Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2020047
(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))))))