1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -220425257.605022430419921875:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y}, \frac{x}{y}\right) - \frac{1}{y}\right)\\
\mathbf{elif}\;y \le 20833302.402704142034053802490234375:\\
\;\;\;\;1 - \log \left(\left(1 - \frac{x}{1 - y}\right) + \frac{y}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y}, \frac{x}{y}\right) - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r15702452 = 1.0;
double r15702453 = x;
double r15702454 = y;
double r15702455 = r15702453 - r15702454;
double r15702456 = r15702452 - r15702454;
double r15702457 = r15702455 / r15702456;
double r15702458 = r15702452 - r15702457;
double r15702459 = log(r15702458);
double r15702460 = r15702452 - r15702459;
return r15702460;
}
double f(double x, double y) {
double r15702461 = y;
double r15702462 = -220425257.60502243;
bool r15702463 = r15702461 <= r15702462;
double r15702464 = 1.0;
double r15702465 = x;
double r15702466 = r15702465 / r15702461;
double r15702467 = r15702464 / r15702461;
double r15702468 = fma(r15702466, r15702467, r15702466);
double r15702469 = r15702468 - r15702467;
double r15702470 = log(r15702469);
double r15702471 = r15702464 - r15702470;
double r15702472 = 20833302.402704142;
bool r15702473 = r15702461 <= r15702472;
double r15702474 = r15702464 - r15702461;
double r15702475 = r15702465 / r15702474;
double r15702476 = r15702464 - r15702475;
double r15702477 = r15702461 / r15702474;
double r15702478 = r15702476 + r15702477;
double r15702479 = log(r15702478);
double r15702480 = r15702464 - r15702479;
double r15702481 = r15702473 ? r15702480 : r15702471;
double r15702482 = r15702463 ? r15702471 : r15702481;
return r15702482;
}




Bits error versus x




Bits error versus y
| Original | 18.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -220425257.60502243 or 20833302.402704142 < y Initial program 46.7
rmApplied div-sub46.7
Applied associate--r-46.7
Taylor expanded around inf 0.1
Simplified0.1
if -220425257.60502243 < y < 20833302.402704142Initial program 0.1
rmApplied div-sub0.1
Applied associate--r-0.1
Final simplification0.1
herbie shell --seed 2019192 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))