1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -212491914.1913111507892608642578125 \lor \neg \left(y \le 54137734.38243345916271209716796875\right):\\
\;\;\;\;1 - \log \left(\left(1 + \frac{1}{y}\right) \cdot \frac{x}{y} - \frac{1}{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 r282121 = 1.0;
double r282122 = x;
double r282123 = y;
double r282124 = r282122 - r282123;
double r282125 = r282121 - r282123;
double r282126 = r282124 / r282125;
double r282127 = r282121 - r282126;
double r282128 = log(r282127);
double r282129 = r282121 - r282128;
return r282129;
}
double f(double x, double y) {
double r282130 = y;
double r282131 = -212491914.19131115;
bool r282132 = r282130 <= r282131;
double r282133 = 54137734.38243346;
bool r282134 = r282130 <= r282133;
double r282135 = !r282134;
bool r282136 = r282132 || r282135;
double r282137 = 1.0;
double r282138 = 1.0;
double r282139 = r282137 / r282130;
double r282140 = r282138 + r282139;
double r282141 = x;
double r282142 = r282141 / r282130;
double r282143 = r282140 * r282142;
double r282144 = r282143 - r282139;
double r282145 = log(r282144);
double r282146 = r282137 - r282145;
double r282147 = exp(r282137);
double r282148 = r282141 - r282130;
double r282149 = r282137 - r282130;
double r282150 = r282148 / r282149;
double r282151 = r282137 - r282150;
double r282152 = r282147 / r282151;
double r282153 = log(r282152);
double r282154 = r282136 ? r282146 : r282153;
return r282154;
}




Bits error versus x




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