1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -96388745.0459894985 \lor \neg \left(y \le 31980879.8987302519\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 r414730 = 1.0;
double r414731 = x;
double r414732 = y;
double r414733 = r414731 - r414732;
double r414734 = r414730 - r414732;
double r414735 = r414733 / r414734;
double r414736 = r414730 - r414735;
double r414737 = log(r414736);
double r414738 = r414730 - r414737;
return r414738;
}
double f(double x, double y) {
double r414739 = y;
double r414740 = -96388745.0459895;
bool r414741 = r414739 <= r414740;
double r414742 = 31980879.898730252;
bool r414743 = r414739 <= r414742;
double r414744 = !r414743;
bool r414745 = r414741 || r414744;
double r414746 = 1.0;
double r414747 = x;
double r414748 = 2.0;
double r414749 = pow(r414739, r414748);
double r414750 = r414747 / r414749;
double r414751 = 1.0;
double r414752 = r414751 / r414739;
double r414753 = r414750 - r414752;
double r414754 = r414746 * r414753;
double r414755 = r414747 / r414739;
double r414756 = r414754 + r414755;
double r414757 = log(r414756);
double r414758 = r414746 - r414757;
double r414759 = r414747 - r414739;
double r414760 = r414746 - r414739;
double r414761 = cbrt(r414760);
double r414762 = r414761 * r414761;
double r414763 = r414759 / r414762;
double r414764 = r414763 / r414761;
double r414765 = r414746 - r414764;
double r414766 = log(r414765);
double r414767 = r414746 - r414766;
double r414768 = r414745 ? r414758 : r414767;
return r414768;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -96388745.0459895 or 31980879.898730252 < y Initial program 47.3
Taylor expanded around inf 0.1
Simplified0.1
if -96388745.0459895 < y < 31980879.898730252Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
Final simplification0.1
herbie shell --seed 2020049
(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))))))