1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.99999997937035734:\\
\;\;\;\;1 - \log \left(1 - \frac{\frac{x - y}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - 1 \cdot \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r487410 = 1.0;
double r487411 = x;
double r487412 = y;
double r487413 = r487411 - r487412;
double r487414 = r487410 - r487412;
double r487415 = r487413 / r487414;
double r487416 = r487410 - r487415;
double r487417 = log(r487416);
double r487418 = r487410 - r487417;
return r487418;
}
double f(double x, double y) {
double r487419 = x;
double r487420 = y;
double r487421 = r487419 - r487420;
double r487422 = 1.0;
double r487423 = r487422 - r487420;
double r487424 = r487421 / r487423;
double r487425 = 0.9999999793703573;
bool r487426 = r487424 <= r487425;
double r487427 = cbrt(r487423);
double r487428 = r487427 * r487427;
double r487429 = r487421 / r487428;
double r487430 = r487429 / r487427;
double r487431 = r487422 - r487430;
double r487432 = log(r487431);
double r487433 = r487422 - r487432;
double r487434 = r487419 / r487420;
double r487435 = 2.0;
double r487436 = pow(r487420, r487435);
double r487437 = r487419 / r487436;
double r487438 = r487422 * r487437;
double r487439 = r487434 + r487438;
double r487440 = 1.0;
double r487441 = r487440 / r487420;
double r487442 = r487422 * r487441;
double r487443 = r487439 - r487442;
double r487444 = log(r487443);
double r487445 = r487422 - r487444;
double r487446 = r487426 ? r487433 : r487445;
return r487446;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9999999793703573Initial program 0.1
rmApplied add-cube-cbrt0.2
Applied associate-/r*0.2
if 0.9999999793703573 < (/ (- x y) (- 1.0 y)) Initial program 62.9
rmApplied flip3--62.9
Simplified62.9
Taylor expanded around inf 0.1
Final simplification0.2
herbie shell --seed 2020027
(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))))))