1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -201288582.2730185985565185546875 \lor \neg \left(y \le 116648832255.3203277587890625\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r465537 = 1.0;
double r465538 = x;
double r465539 = y;
double r465540 = r465538 - r465539;
double r465541 = r465537 - r465539;
double r465542 = r465540 / r465541;
double r465543 = r465537 - r465542;
double r465544 = log(r465543);
double r465545 = r465537 - r465544;
return r465545;
}
double f(double x, double y) {
double r465546 = y;
double r465547 = -201288582.2730186;
bool r465548 = r465546 <= r465547;
double r465549 = 116648832255.32033;
bool r465550 = r465546 <= r465549;
double r465551 = !r465550;
bool r465552 = r465548 || r465551;
double r465553 = 1.0;
double r465554 = exp(r465553);
double r465555 = x;
double r465556 = 2.0;
double r465557 = pow(r465546, r465556);
double r465558 = r465555 / r465557;
double r465559 = 1.0;
double r465560 = r465559 / r465546;
double r465561 = r465558 - r465560;
double r465562 = r465555 / r465546;
double r465563 = fma(r465553, r465561, r465562);
double r465564 = r465554 / r465563;
double r465565 = log(r465564);
double r465566 = r465555 - r465546;
double r465567 = r465553 - r465546;
double r465568 = r465566 / r465567;
double r465569 = r465553 - r465568;
double r465570 = r465554 / r465569;
double r465571 = log(r465570);
double r465572 = r465552 ? r465565 : r465571;
return r465572;
}




Bits error versus x




Bits error versus y
| Original | 17.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -201288582.2730186 or 116648832255.32033 < y Initial program 46.3
rmApplied add-log-exp46.3
Applied diff-log46.3
Taylor expanded around inf 0.2
Simplified0.2
if -201288582.2730186 < y < 116648832255.32033Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019362 +o rules:numerics
(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))))))