1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -51178879.934393361 \lor \neg \left(y \le 53143023.8704946265\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, 1, \frac{x}{y}\right) - \frac{1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(1 - \frac{{\left(\sqrt[3]{x - y}\right)}^{3}}{1 - y}\right) + \left(\frac{{\left(\sqrt[3]{x - y}\right)}^{3}}{1 - y} - \frac{{\left(\sqrt[3]{x - y}\right)}^{3}}{1 - y}\right)\right)\\
\end{array}double f(double x, double y) {
double r351523 = 1.0;
double r351524 = x;
double r351525 = y;
double r351526 = r351524 - r351525;
double r351527 = r351523 - r351525;
double r351528 = r351526 / r351527;
double r351529 = r351523 - r351528;
double r351530 = log(r351529);
double r351531 = r351523 - r351530;
return r351531;
}
double f(double x, double y) {
double r351532 = y;
double r351533 = -51178879.93439336;
bool r351534 = r351532 <= r351533;
double r351535 = 53143023.87049463;
bool r351536 = r351532 <= r351535;
double r351537 = !r351536;
bool r351538 = r351534 || r351537;
double r351539 = 1.0;
double r351540 = exp(r351539);
double r351541 = x;
double r351542 = 2.0;
double r351543 = pow(r351532, r351542);
double r351544 = r351541 / r351543;
double r351545 = r351541 / r351532;
double r351546 = fma(r351544, r351539, r351545);
double r351547 = r351539 / r351532;
double r351548 = r351546 - r351547;
double r351549 = r351540 / r351548;
double r351550 = log(r351549);
double r351551 = r351541 - r351532;
double r351552 = cbrt(r351551);
double r351553 = 3.0;
double r351554 = pow(r351552, r351553);
double r351555 = r351539 - r351532;
double r351556 = r351554 / r351555;
double r351557 = r351539 - r351556;
double r351558 = r351556 - r351556;
double r351559 = r351557 + r351558;
double r351560 = log(r351559);
double r351561 = r351539 - r351560;
double r351562 = r351538 ? r351550 : r351561;
return r351562;
}




Bits error versus x




Bits error versus y
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -51178879.93439336 or 53143023.87049463 < y Initial program 47.0
rmApplied add-log-exp47.0
Applied diff-log47.0
Taylor expanded around inf 0.2
Simplified0.2
if -51178879.93439336 < y < 53143023.87049463Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied add-cube-cbrt0.1
Applied times-frac0.1
Applied add-sqr-sqrt0.1
Applied prod-diff0.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020047 +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))))))