1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 3.960614984267581169834128874268630582378 \cdot 10^{-8}:\\
\;\;\;\;1 - \log \left(1 - \frac{1}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}} \cdot \frac{x - y}{\sqrt[3]{1 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{x}{{y}^{2}}, 1, \frac{x}{y}\right) - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r290168 = 1.0;
double r290169 = x;
double r290170 = y;
double r290171 = r290169 - r290170;
double r290172 = r290168 - r290170;
double r290173 = r290171 / r290172;
double r290174 = r290168 - r290173;
double r290175 = log(r290174);
double r290176 = r290168 - r290175;
return r290176;
}
double f(double x, double y) {
double r290177 = x;
double r290178 = y;
double r290179 = r290177 - r290178;
double r290180 = 1.0;
double r290181 = r290180 - r290178;
double r290182 = r290179 / r290181;
double r290183 = 3.960614984267581e-08;
bool r290184 = r290182 <= r290183;
double r290185 = 1.0;
double r290186 = cbrt(r290181);
double r290187 = r290186 * r290186;
double r290188 = r290185 / r290187;
double r290189 = r290179 / r290186;
double r290190 = r290188 * r290189;
double r290191 = r290180 - r290190;
double r290192 = log(r290191);
double r290193 = r290180 - r290192;
double r290194 = 2.0;
double r290195 = pow(r290178, r290194);
double r290196 = r290177 / r290195;
double r290197 = r290177 / r290178;
double r290198 = fma(r290196, r290180, r290197);
double r290199 = r290180 / r290178;
double r290200 = r290198 - r290199;
double r290201 = log(r290200);
double r290202 = r290180 - r290201;
double r290203 = r290184 ? r290193 : r290202;
return r290203;
}




Bits error versus x




Bits error versus y
| Original | 18.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.8 |
if (/ (- x y) (- 1.0 y)) < 3.960614984267581e-08Initial program 0.0
rmApplied add-cube-cbrt0.0
Applied *-un-lft-identity0.0
Applied times-frac0.0
if 3.960614984267581e-08 < (/ (- x y) (- 1.0 y)) Initial program 58.9
Taylor expanded around inf 2.6
Simplified2.6
Final simplification0.8
herbie shell --seed 2019212 +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.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))))))