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):\\
\;\;\;\;\log \left(\frac{e^{1}}{\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 r244166 = 1.0;
double r244167 = x;
double r244168 = y;
double r244169 = r244167 - r244168;
double r244170 = r244166 - r244168;
double r244171 = r244169 / r244170;
double r244172 = r244166 - r244171;
double r244173 = log(r244172);
double r244174 = r244166 - r244173;
return r244174;
}
double f(double x, double y) {
double r244175 = y;
double r244176 = -212491914.19131115;
bool r244177 = r244175 <= r244176;
double r244178 = 54137734.38243346;
bool r244179 = r244175 <= r244178;
double r244180 = !r244179;
bool r244181 = r244177 || r244180;
double r244182 = 1.0;
double r244183 = exp(r244182);
double r244184 = 1.0;
double r244185 = r244182 / r244175;
double r244186 = r244184 + r244185;
double r244187 = x;
double r244188 = r244187 / r244175;
double r244189 = r244186 * r244188;
double r244190 = r244189 - r244185;
double r244191 = r244183 / r244190;
double r244192 = log(r244191);
double r244193 = r244187 - r244175;
double r244194 = r244182 - r244175;
double r244195 = r244193 / r244194;
double r244196 = r244182 - r244195;
double r244197 = r244183 / r244196;
double r244198 = log(r244197);
double r244199 = r244181 ? r244192 : r244198;
return r244199;
}




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
rmApplied add-log-exp46.7
Applied diff-log46.7
Taylor expanded around inf 0.2
Simplified0.2
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))))))