1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -1630045945.92276692 \lor \neg \left(y \le 76447033.3308169693\right):\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - 1 \cdot \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{1}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}} \cdot \frac{x - y}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r412356 = 1.0;
double r412357 = x;
double r412358 = y;
double r412359 = r412357 - r412358;
double r412360 = r412356 - r412358;
double r412361 = r412359 / r412360;
double r412362 = r412356 - r412361;
double r412363 = log(r412362);
double r412364 = r412356 - r412363;
return r412364;
}
double f(double x, double y) {
double r412365 = y;
double r412366 = -1630045945.922767;
bool r412367 = r412365 <= r412366;
double r412368 = 76447033.33081697;
bool r412369 = r412365 <= r412368;
double r412370 = !r412369;
bool r412371 = r412367 || r412370;
double r412372 = 1.0;
double r412373 = x;
double r412374 = r412373 / r412365;
double r412375 = 2.0;
double r412376 = pow(r412365, r412375);
double r412377 = r412373 / r412376;
double r412378 = r412372 * r412377;
double r412379 = r412374 + r412378;
double r412380 = 1.0;
double r412381 = r412380 / r412365;
double r412382 = r412372 * r412381;
double r412383 = r412379 - r412382;
double r412384 = log(r412383);
double r412385 = r412372 - r412384;
double r412386 = r412372 - r412365;
double r412387 = cbrt(r412386);
double r412388 = r412387 * r412387;
double r412389 = r412380 / r412388;
double r412390 = r412373 - r412365;
double r412391 = r412390 / r412387;
double r412392 = r412389 * r412391;
double r412393 = r412372 - r412392;
double r412394 = log(r412393);
double r412395 = r412372 - r412394;
double r412396 = r412371 ? r412385 : r412395;
return r412396;
}




Bits error versus x




Bits error versus y
Results
| Original | 17.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -1630045945.922767 or 76447033.33081697 < y Initial program 46.1
rmApplied flip3--53.3
Simplified53.3
Taylor expanded around inf 0.1
if -1630045945.922767 < y < 76447033.33081697Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
Final simplification0.1
herbie shell --seed 2020062 +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))))))