1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -9.186493886184318 \cdot 10^{36} \lor \neg \left(y \le 49288711.7499881461\right):\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \frac{\sqrt[3]{x - y}}{1 - y}\right)\\
\end{array}double f(double x, double y) {
double r330261 = 1.0;
double r330262 = x;
double r330263 = y;
double r330264 = r330262 - r330263;
double r330265 = r330261 - r330263;
double r330266 = r330264 / r330265;
double r330267 = r330261 - r330266;
double r330268 = log(r330267);
double r330269 = r330261 - r330268;
return r330269;
}
double f(double x, double y) {
double r330270 = y;
double r330271 = -9.186493886184318e+36;
bool r330272 = r330270 <= r330271;
double r330273 = 49288711.749988146;
bool r330274 = r330270 <= r330273;
double r330275 = !r330274;
bool r330276 = r330272 || r330275;
double r330277 = 1.0;
double r330278 = x;
double r330279 = r330278 / r330270;
double r330280 = 2.0;
double r330281 = pow(r330270, r330280);
double r330282 = r330278 / r330281;
double r330283 = r330277 * r330282;
double r330284 = r330279 + r330283;
double r330285 = r330277 / r330270;
double r330286 = r330284 - r330285;
double r330287 = log(r330286);
double r330288 = r330277 - r330287;
double r330289 = r330278 - r330270;
double r330290 = cbrt(r330289);
double r330291 = r330290 * r330290;
double r330292 = r330277 - r330270;
double r330293 = r330290 / r330292;
double r330294 = r330291 * r330293;
double r330295 = r330277 - r330294;
double r330296 = log(r330295);
double r330297 = r330277 - r330296;
double r330298 = r330276 ? r330288 : r330297;
return r330298;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 1.2 |
if y < -9.186493886184318e+36 or 49288711.749988146 < y Initial program 48.0
Taylor expanded around inf 0.0
Simplified0.0
if -9.186493886184318e+36 < y < 49288711.749988146Initial program 2.0
rmApplied *-un-lft-identity2.0
Applied add-cube-cbrt1.9
Applied times-frac1.9
Simplified1.9
Final simplification1.2
herbie shell --seed 2019198
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))