1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -106501299.420671895 \lor \neg \left(y \le 73789365.95162582\right):\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \left(\sqrt[3]{\frac{x}{{y}^{2}} - \frac{1}{y}} \cdot \sqrt[3]{\frac{x}{{y}^{2}} - \frac{1}{y}}\right) \cdot \sqrt[3]{\frac{x}{{y}^{2}} - \frac{1}{y}}, \frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(\log \left(\sqrt{1 - \left(x - y\right) \cdot \frac{1}{1 - y}}\right) + \log \left(\sqrt{1 - \left(x - y\right) \cdot \frac{1}{1 - y}}\right)\right)\\
\end{array}double f(double x, double y) {
double r386635 = 1.0;
double r386636 = x;
double r386637 = y;
double r386638 = r386636 - r386637;
double r386639 = r386635 - r386637;
double r386640 = r386638 / r386639;
double r386641 = r386635 - r386640;
double r386642 = log(r386641);
double r386643 = r386635 - r386642;
return r386643;
}
double f(double x, double y) {
double r386644 = y;
double r386645 = -106501299.4206719;
bool r386646 = r386644 <= r386645;
double r386647 = 73789365.95162582;
bool r386648 = r386644 <= r386647;
double r386649 = !r386648;
bool r386650 = r386646 || r386649;
double r386651 = 1.0;
double r386652 = x;
double r386653 = 2.0;
double r386654 = pow(r386644, r386653);
double r386655 = r386652 / r386654;
double r386656 = 1.0;
double r386657 = r386656 / r386644;
double r386658 = r386655 - r386657;
double r386659 = cbrt(r386658);
double r386660 = r386659 * r386659;
double r386661 = r386660 * r386659;
double r386662 = r386652 / r386644;
double r386663 = fma(r386651, r386661, r386662);
double r386664 = log(r386663);
double r386665 = r386651 - r386664;
double r386666 = r386652 - r386644;
double r386667 = r386651 - r386644;
double r386668 = r386656 / r386667;
double r386669 = r386666 * r386668;
double r386670 = r386651 - r386669;
double r386671 = sqrt(r386670);
double r386672 = log(r386671);
double r386673 = r386672 + r386672;
double r386674 = r386651 - r386673;
double r386675 = r386650 ? r386665 : r386674;
return r386675;
}




Bits error versus x




Bits error versus y
| Original | 18.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -106501299.4206719 or 73789365.95162582 < y Initial program 46.8
Taylor expanded around inf 0.2
Simplified0.2
rmApplied add-cube-cbrt0.2
if -106501299.4206719 < y < 73789365.95162582Initial program 0.1
rmApplied div-inv0.1
rmApplied add-sqr-sqrt0.1
Applied log-prod0.1
Final simplification0.1
herbie shell --seed 2020056 +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))))))