1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.9993340856260311:\\
\;\;\;\;1 - \log \left(1 - \left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \frac{\sqrt[3]{x - y}}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)\right)\\
\end{array}double f(double x, double y) {
double r315903 = 1.0;
double r315904 = x;
double r315905 = y;
double r315906 = r315904 - r315905;
double r315907 = r315903 - r315905;
double r315908 = r315906 / r315907;
double r315909 = r315903 - r315908;
double r315910 = log(r315909);
double r315911 = r315903 - r315910;
return r315911;
}
double f(double x, double y) {
double r315912 = x;
double r315913 = y;
double r315914 = r315912 - r315913;
double r315915 = 1.0;
double r315916 = r315915 - r315913;
double r315917 = r315914 / r315916;
double r315918 = 0.9993340856260311;
bool r315919 = r315917 <= r315918;
double r315920 = cbrt(r315914);
double r315921 = r315920 * r315920;
double r315922 = r315920 / r315916;
double r315923 = r315921 * r315922;
double r315924 = r315915 - r315923;
double r315925 = log(r315924);
double r315926 = r315915 - r315925;
double r315927 = 2.0;
double r315928 = pow(r315913, r315927);
double r315929 = r315912 / r315928;
double r315930 = 1.0;
double r315931 = r315930 / r315913;
double r315932 = r315929 - r315931;
double r315933 = r315912 / r315913;
double r315934 = fma(r315915, r315932, r315933);
double r315935 = log(r315934);
double r315936 = r315915 - r315935;
double r315937 = r315919 ? r315926 : r315936;
return r315937;
}




Bits error versus x




Bits error versus y
| Original | 18.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9993340856260311Initial program 0.0
rmApplied *-un-lft-identity0.0
Applied add-cube-cbrt0.1
Applied times-frac0.1
Simplified0.1
if 0.9993340856260311 < (/ (- x y) (- 1.0 y)) Initial program 61.9
Taylor expanded around inf 0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2020021 +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))))))