1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.09185737703913710028302830323809757828712:\\
\;\;\;\;1 - \log \left(1 - \frac{1}{1 - y} \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + \frac{x}{y} \cdot \frac{1}{y}\right) - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r19968542 = 1.0;
double r19968543 = x;
double r19968544 = y;
double r19968545 = r19968543 - r19968544;
double r19968546 = r19968542 - r19968544;
double r19968547 = r19968545 / r19968546;
double r19968548 = r19968542 - r19968547;
double r19968549 = log(r19968548);
double r19968550 = r19968542 - r19968549;
return r19968550;
}
double f(double x, double y) {
double r19968551 = x;
double r19968552 = y;
double r19968553 = r19968551 - r19968552;
double r19968554 = 1.0;
double r19968555 = r19968554 - r19968552;
double r19968556 = r19968553 / r19968555;
double r19968557 = 0.0918573770391371;
bool r19968558 = r19968556 <= r19968557;
double r19968559 = 1.0;
double r19968560 = r19968559 / r19968555;
double r19968561 = r19968560 * r19968553;
double r19968562 = r19968554 - r19968561;
double r19968563 = log(r19968562);
double r19968564 = r19968554 - r19968563;
double r19968565 = r19968551 / r19968552;
double r19968566 = r19968554 / r19968552;
double r19968567 = r19968565 * r19968566;
double r19968568 = r19968565 + r19968567;
double r19968569 = r19968568 - r19968566;
double r19968570 = log(r19968569);
double r19968571 = r19968554 - r19968570;
double r19968572 = r19968558 ? r19968564 : r19968571;
return r19968572;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
if (/ (- x y) (- 1.0 y)) < 0.0918573770391371Initial program 0.0
rmApplied div-inv0.0
if 0.0918573770391371 < (/ (- x y) (- 1.0 y)) Initial program 60.7
rmApplied div-inv59.2
Taylor expanded around inf 1.0
Simplified1.0
Final simplification0.3
herbie shell --seed 2019200
(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))))))