1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le \frac{-64129817537929}{1048576} \lor \neg \left(y \le \frac{4535396767118165}{134217728}\right):\\
\;\;\;\;1 - \log \left(\frac{x}{y} - \left(\frac{1}{y} - 1 \cdot \frac{x}{{y}^{2}}\right)\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 r326530 = 1.0;
double r326531 = x;
double r326532 = y;
double r326533 = r326531 - r326532;
double r326534 = r326530 - r326532;
double r326535 = r326533 / r326534;
double r326536 = r326530 - r326535;
double r326537 = log(r326536);
double r326538 = r326530 - r326537;
return r326538;
}
double f(double x, double y) {
double r326539 = y;
double r326540 = -64129817537929.0;
double r326541 = 1048576.0;
double r326542 = r326540 / r326541;
bool r326543 = r326539 <= r326542;
double r326544 = 4535396767118165.0;
double r326545 = 134217728.0;
double r326546 = r326544 / r326545;
bool r326547 = r326539 <= r326546;
double r326548 = !r326547;
bool r326549 = r326543 || r326548;
double r326550 = 1.0;
double r326551 = x;
double r326552 = r326551 / r326539;
double r326553 = r326550 / r326539;
double r326554 = 2.0;
double r326555 = pow(r326539, r326554);
double r326556 = r326551 / r326555;
double r326557 = r326550 * r326556;
double r326558 = r326553 - r326557;
double r326559 = r326552 - r326558;
double r326560 = log(r326559);
double r326561 = r326550 - r326560;
double r326562 = 1.0;
double r326563 = r326550 - r326539;
double r326564 = cbrt(r326563);
double r326565 = r326564 * r326564;
double r326566 = r326562 / r326565;
double r326567 = r326551 - r326539;
double r326568 = r326567 / r326564;
double r326569 = r326566 * r326568;
double r326570 = r326550 - r326569;
double r326571 = log(r326570);
double r326572 = r326550 - r326571;
double r326573 = r326549 ? r326561 : r326572;
return r326573;
}




Bits error versus x




Bits error versus y
Results
| Original | 17.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -61158959.90174198 or 33791339.15244166 < y Initial program 46.1
rmApplied add-cube-cbrt42.3
Applied *-un-lft-identity42.3
Applied times-frac42.2
Taylor expanded around inf 0.1
Simplified0.1
if -61158959.90174198 < y < 33791339.15244166Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
Final simplification0.1
herbie shell --seed 2019303
(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))))))