1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -325586491895.521545 \lor \neg \left(y \le 36683682.5736824796\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{\frac{x - y}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r595273 = 1.0;
double r595274 = x;
double r595275 = y;
double r595276 = r595274 - r595275;
double r595277 = r595273 - r595275;
double r595278 = r595276 / r595277;
double r595279 = r595273 - r595278;
double r595280 = log(r595279);
double r595281 = r595273 - r595280;
return r595281;
}
double f(double x, double y) {
double r595282 = y;
double r595283 = -325586491895.52155;
bool r595284 = r595282 <= r595283;
double r595285 = 36683682.57368248;
bool r595286 = r595282 <= r595285;
double r595287 = !r595286;
bool r595288 = r595284 || r595287;
double r595289 = 1.0;
double r595290 = x;
double r595291 = r595290 / r595282;
double r595292 = 2.0;
double r595293 = pow(r595282, r595292);
double r595294 = r595290 / r595293;
double r595295 = r595289 * r595294;
double r595296 = r595291 + r595295;
double r595297 = 1.0;
double r595298 = r595297 / r595282;
double r595299 = r595289 * r595298;
double r595300 = r595296 - r595299;
double r595301 = log(r595300);
double r595302 = r595289 - r595301;
double r595303 = r595290 - r595282;
double r595304 = r595289 - r595282;
double r595305 = cbrt(r595304);
double r595306 = r595305 * r595305;
double r595307 = r595303 / r595306;
double r595308 = r595307 / r595305;
double r595309 = r595289 - r595308;
double r595310 = log(r595309);
double r595311 = r595289 - r595310;
double r595312 = r595288 ? r595302 : r595311;
return r595312;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -325586491895.52155 or 36683682.57368248 < y Initial program 47.2
rmApplied add-cube-cbrt43.4
Applied associate-/r*43.4
Taylor expanded around inf 0.0
if -325586491895.52155 < y < 36683682.57368248Initial program 0.2
rmApplied add-cube-cbrt0.2
Applied associate-/r*0.2
Final simplification0.1
herbie shell --seed 2020034 +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))))))