1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -69178602.405435622 \lor \neg \left(y \le 53143023.8704946265\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, 1, \frac{x}{y}\right) - \frac{1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{\frac{\frac{x - y}{\sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r499256 = 1.0;
double r499257 = x;
double r499258 = y;
double r499259 = r499257 - r499258;
double r499260 = r499256 - r499258;
double r499261 = r499259 / r499260;
double r499262 = r499256 - r499261;
double r499263 = log(r499262);
double r499264 = r499256 - r499263;
return r499264;
}
double f(double x, double y) {
double r499265 = y;
double r499266 = -69178602.40543562;
bool r499267 = r499265 <= r499266;
double r499268 = 53143023.87049463;
bool r499269 = r499265 <= r499268;
double r499270 = !r499269;
bool r499271 = r499267 || r499270;
double r499272 = 1.0;
double r499273 = exp(r499272);
double r499274 = x;
double r499275 = 2.0;
double r499276 = pow(r499265, r499275);
double r499277 = r499274 / r499276;
double r499278 = r499274 / r499265;
double r499279 = fma(r499277, r499272, r499278);
double r499280 = r499272 / r499265;
double r499281 = r499279 - r499280;
double r499282 = r499273 / r499281;
double r499283 = log(r499282);
double r499284 = r499274 - r499265;
double r499285 = r499272 - r499265;
double r499286 = cbrt(r499285);
double r499287 = r499284 / r499286;
double r499288 = r499287 / r499286;
double r499289 = r499288 / r499286;
double r499290 = r499272 - r499289;
double r499291 = log(r499290);
double r499292 = r499272 - r499291;
double r499293 = r499271 ? r499283 : r499292;
return r499293;
}




Bits error versus x




Bits error versus y
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -69178602.40543562 or 53143023.87049463 < y Initial program 47.1
rmApplied add-log-exp47.1
Applied diff-log47.1
Taylor expanded around inf 0.1
Simplified0.1
if -69178602.40543562 < y < 53143023.87049463Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020047 +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))))))