1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -2635583561575173 \lor \neg \left(y \le 17964049.731224976480007171630859375\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{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 r338264 = 1.0;
double r338265 = x;
double r338266 = y;
double r338267 = r338265 - r338266;
double r338268 = r338264 - r338266;
double r338269 = r338267 / r338268;
double r338270 = r338264 - r338269;
double r338271 = log(r338270);
double r338272 = r338264 - r338271;
return r338272;
}
double f(double x, double y) {
double r338273 = y;
double r338274 = -2635583561575173.0;
bool r338275 = r338273 <= r338274;
double r338276 = 17964049.731224976;
bool r338277 = r338273 <= r338276;
double r338278 = !r338277;
bool r338279 = r338275 || r338278;
double r338280 = 1.0;
double r338281 = exp(r338280);
double r338282 = x;
double r338283 = 2.0;
double r338284 = pow(r338273, r338283);
double r338285 = r338282 / r338284;
double r338286 = 1.0;
double r338287 = r338286 / r338273;
double r338288 = r338285 - r338287;
double r338289 = r338280 * r338288;
double r338290 = r338282 / r338273;
double r338291 = r338289 + r338290;
double r338292 = r338281 / r338291;
double r338293 = log(r338292);
double r338294 = r338282 - r338273;
double r338295 = r338280 - r338273;
double r338296 = cbrt(r338295);
double r338297 = r338296 * r338296;
double r338298 = r338294 / r338297;
double r338299 = r338298 / r338296;
double r338300 = r338280 - r338299;
double r338301 = log(r338300);
double r338302 = r338280 - r338301;
double r338303 = r338279 ? r338293 : r338302;
return r338303;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
if y < -2635583561575173.0 or 17964049.731224976 < y Initial program 46.1
rmApplied add-log-exp46.1
Applied diff-log46.1
Taylor expanded around inf 0.1
Simplified0.1
if -2635583561575173.0 < y < 17964049.731224976Initial program 0.4
rmApplied add-cube-cbrt0.4
Applied associate-/r*0.4
Final simplification0.3
herbie shell --seed 1978988140
(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))))))