1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.03024915003939501398355638173143233871087:\\
\;\;\;\;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{1}{y} + 1\right) \cdot \frac{x}{y} - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r285832 = 1.0;
double r285833 = x;
double r285834 = y;
double r285835 = r285833 - r285834;
double r285836 = r285832 - r285834;
double r285837 = r285835 / r285836;
double r285838 = r285832 - r285837;
double r285839 = log(r285838);
double r285840 = r285832 - r285839;
return r285840;
}
double f(double x, double y) {
double r285841 = x;
double r285842 = y;
double r285843 = r285841 - r285842;
double r285844 = 1.0;
double r285845 = r285844 - r285842;
double r285846 = r285843 / r285845;
double r285847 = 0.030249150039395014;
bool r285848 = r285846 <= r285847;
double r285849 = cbrt(r285845);
double r285850 = r285849 * r285849;
double r285851 = r285843 / r285850;
double r285852 = r285851 / r285849;
double r285853 = r285844 - r285852;
double r285854 = log(r285853);
double r285855 = r285844 - r285854;
double r285856 = r285844 / r285842;
double r285857 = 1.0;
double r285858 = r285856 + r285857;
double r285859 = r285841 / r285842;
double r285860 = r285858 * r285859;
double r285861 = r285860 - r285856;
double r285862 = log(r285861);
double r285863 = r285844 - r285862;
double r285864 = r285848 ? r285855 : r285863;
return r285864;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
if (/ (- x y) (- 1.0 y)) < 0.030249150039395014Initial program 0.0
rmApplied add-cube-cbrt0.0
Applied associate-/r*0.0
if 0.030249150039395014 < (/ (- x y) (- 1.0 y)) Initial program 60.5
rmApplied add-cube-cbrt55.9
Applied associate-/r*55.9
Taylor expanded around inf 1.1
Simplified1.1
Final simplification0.3
herbie shell --seed 2019306
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.619472414) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))