1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -119577009.99898484 \lor \neg \left(y \le 25589815.688386947\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\frac{x}{y} + \left(1 \cdot \frac{x}{{y}^{2}} - \frac{1}{y}\right)}\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 r477539 = 1.0;
double r477540 = x;
double r477541 = y;
double r477542 = r477540 - r477541;
double r477543 = r477539 - r477541;
double r477544 = r477542 / r477543;
double r477545 = r477539 - r477544;
double r477546 = log(r477545);
double r477547 = r477539 - r477546;
return r477547;
}
double f(double x, double y) {
double r477548 = y;
double r477549 = -119577009.99898484;
bool r477550 = r477548 <= r477549;
double r477551 = 25589815.688386947;
bool r477552 = r477548 <= r477551;
double r477553 = !r477552;
bool r477554 = r477550 || r477553;
double r477555 = 1.0;
double r477556 = exp(r477555);
double r477557 = x;
double r477558 = r477557 / r477548;
double r477559 = 2.0;
double r477560 = pow(r477548, r477559);
double r477561 = r477557 / r477560;
double r477562 = r477555 * r477561;
double r477563 = r477555 / r477548;
double r477564 = r477562 - r477563;
double r477565 = r477558 + r477564;
double r477566 = r477556 / r477565;
double r477567 = log(r477566);
double r477568 = r477557 - r477548;
double r477569 = 1.0;
double r477570 = r477555 - r477548;
double r477571 = r477569 / r477570;
double r477572 = r477568 * r477571;
double r477573 = r477555 - r477572;
double r477574 = log(r477573);
double r477575 = r477555 - r477574;
double r477576 = r477554 ? r477567 : r477575;
return r477576;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -119577009.99898484 or 25589815.688386947 < y Initial program 46.9
rmApplied add-log-exp46.9
Applied diff-log46.9
Taylor expanded around inf 0.2
Simplified0.2
if -119577009.99898484 < y < 25589815.688386947Initial program 0.1
rmApplied div-inv0.1
Final simplification0.1
herbie shell --seed 2020046
(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))))))