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(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r312403 = 1.0;
double r312404 = x;
double r312405 = y;
double r312406 = r312404 - r312405;
double r312407 = r312403 - r312405;
double r312408 = r312406 / r312407;
double r312409 = r312403 - r312408;
double r312410 = log(r312409);
double r312411 = r312403 - r312410;
return r312411;
}
double f(double x, double y) {
double r312412 = x;
double r312413 = y;
double r312414 = r312412 - r312413;
double r312415 = 1.0;
double r312416 = r312415 - r312413;
double r312417 = r312414 / r312416;
double r312418 = 3.960614984267581e-08;
bool r312419 = r312417 <= r312418;
double r312420 = 1.0;
double r312421 = cbrt(r312416);
double r312422 = r312421 * r312421;
double r312423 = r312420 / r312422;
double r312424 = r312414 / r312421;
double r312425 = r312423 * r312424;
double r312426 = r312415 - r312425;
double r312427 = log(r312426);
double r312428 = r312415 - r312427;
double r312429 = r312412 / r312413;
double r312430 = 2.0;
double r312431 = pow(r312413, r312430);
double r312432 = r312412 / r312431;
double r312433 = r312415 * r312432;
double r312434 = r312429 + r312433;
double r312435 = r312415 / r312413;
double r312436 = r312434 - r312435;
double r312437 = log(r312436);
double r312438 = r312415 - r312437;
double r312439 = r312419 ? r312428 : r312438;
return r312439;
}




Bits error versus x




Bits error versus y
Results
| 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
(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))))))