1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -1630045945.92276692 \lor \neg \left(y \le 76447033.3308169693\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{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 r475355 = 1.0;
double r475356 = x;
double r475357 = y;
double r475358 = r475356 - r475357;
double r475359 = r475355 - r475357;
double r475360 = r475358 / r475359;
double r475361 = r475355 - r475360;
double r475362 = log(r475361);
double r475363 = r475355 - r475362;
return r475363;
}
double f(double x, double y) {
double r475364 = y;
double r475365 = -1630045945.922767;
bool r475366 = r475364 <= r475365;
double r475367 = 76447033.33081697;
bool r475368 = r475364 <= r475367;
double r475369 = !r475368;
bool r475370 = r475366 || r475369;
double r475371 = 1.0;
double r475372 = x;
double r475373 = 2.0;
double r475374 = pow(r475364, r475373);
double r475375 = r475372 / r475374;
double r475376 = 1.0;
double r475377 = r475376 / r475364;
double r475378 = r475375 - r475377;
double r475379 = r475371 * r475378;
double r475380 = r475372 / r475364;
double r475381 = r475379 + r475380;
double r475382 = log(r475381);
double r475383 = r475371 - r475382;
double r475384 = r475372 - r475364;
double r475385 = r475371 - r475364;
double r475386 = r475376 / r475385;
double r475387 = r475384 * r475386;
double r475388 = r475371 - r475387;
double r475389 = log(r475388);
double r475390 = r475371 - r475389;
double r475391 = r475370 ? r475383 : r475390;
return r475391;
}




Bits error versus x




Bits error versus y
Results
| Original | 17.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -1630045945.922767 or 76447033.33081697 < y Initial program 46.1
Taylor expanded around inf 0.1
Simplified0.1
if -1630045945.922767 < y < 76447033.33081697Initial program 0.1
rmApplied div-inv0.1
Final simplification0.1
herbie shell --seed 2020062
(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))))))