1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -152049567.74437964 \lor \neg \left(y \le 8942476.00878707133\right):\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - 1 \cdot \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(1 - \log \left(1 - \frac{x - y}{1 - y}\right)\right)}^{3}}\\
\end{array}double f(double x, double y) {
double r643581 = 1.0;
double r643582 = x;
double r643583 = y;
double r643584 = r643582 - r643583;
double r643585 = r643581 - r643583;
double r643586 = r643584 / r643585;
double r643587 = r643581 - r643586;
double r643588 = log(r643587);
double r643589 = r643581 - r643588;
return r643589;
}
double f(double x, double y) {
double r643590 = y;
double r643591 = -152049567.74437964;
bool r643592 = r643590 <= r643591;
double r643593 = 8942476.008787071;
bool r643594 = r643590 <= r643593;
double r643595 = !r643594;
bool r643596 = r643592 || r643595;
double r643597 = 1.0;
double r643598 = x;
double r643599 = r643598 / r643590;
double r643600 = 2.0;
double r643601 = pow(r643590, r643600);
double r643602 = r643598 / r643601;
double r643603 = r643597 * r643602;
double r643604 = r643599 + r643603;
double r643605 = 1.0;
double r643606 = r643605 / r643590;
double r643607 = r643597 * r643606;
double r643608 = r643604 - r643607;
double r643609 = log(r643608);
double r643610 = r643597 - r643609;
double r643611 = r643598 - r643590;
double r643612 = r643597 - r643590;
double r643613 = r643611 / r643612;
double r643614 = r643597 - r643613;
double r643615 = log(r643614);
double r643616 = r643597 - r643615;
double r643617 = 3.0;
double r643618 = pow(r643616, r643617);
double r643619 = cbrt(r643618);
double r643620 = r643596 ? r643610 : r643619;
return r643620;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if y < -152049567.74437964 or 8942476.008787071 < y Initial program 46.8
rmApplied add-cube-cbrt43.0
Applied associate-/r*43.0
Simplified42.9
Taylor expanded around inf 0.2
if -152049567.74437964 < y < 8942476.008787071Initial program 0.1
rmApplied add-cbrt-cube0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2020045 +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))))))