1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -325586491895.521545 \lor \neg \left(y \le 36683682.5736824796\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{\frac{x - y}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r373725 = 1.0;
double r373726 = x;
double r373727 = y;
double r373728 = r373726 - r373727;
double r373729 = r373725 - r373727;
double r373730 = r373728 / r373729;
double r373731 = r373725 - r373730;
double r373732 = log(r373731);
double r373733 = r373725 - r373732;
return r373733;
}
double f(double x, double y) {
double r373734 = y;
double r373735 = -325586491895.52155;
bool r373736 = r373734 <= r373735;
double r373737 = 36683682.57368248;
bool r373738 = r373734 <= r373737;
double r373739 = !r373738;
bool r373740 = r373736 || r373739;
double r373741 = 1.0;
double r373742 = x;
double r373743 = 2.0;
double r373744 = pow(r373734, r373743);
double r373745 = r373742 / r373744;
double r373746 = 1.0;
double r373747 = r373746 / r373734;
double r373748 = r373745 - r373747;
double r373749 = r373741 * r373748;
double r373750 = r373742 / r373734;
double r373751 = r373749 + r373750;
double r373752 = log(r373751);
double r373753 = r373741 - r373752;
double r373754 = r373742 - r373734;
double r373755 = r373741 - r373734;
double r373756 = cbrt(r373755);
double r373757 = r373756 * r373756;
double r373758 = r373754 / r373757;
double r373759 = r373758 / r373756;
double r373760 = r373741 - r373759;
double r373761 = log(r373760);
double r373762 = r373741 - r373761;
double r373763 = r373740 ? r373753 : r373762;
return r373763;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -325586491895.52155 or 36683682.57368248 < y Initial program 47.2
Taylor expanded around inf 0.0
Simplified0.0
if -325586491895.52155 < y < 36683682.57368248Initial program 0.2
rmApplied add-cube-cbrt0.2
Applied associate-/r*0.2
Final simplification0.1
herbie shell --seed 2020034
(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))))))