1.0 - \log \left(1.0 - \frac{x - y}{1.0 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1.0 - y} \le 0.8581617207853955:\\
\;\;\;\;1.0 - \left(\log \left(\sqrt{1.0 - \frac{x - y}{1.0 - y}}\right) + \log \left(\sqrt{1.0 - \frac{x - y}{1.0 - y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1.0 - \log \left(\mathsf{fma}\left(\frac{x}{y}, \frac{1.0}{y}, \frac{x}{y} - \frac{1.0}{y}\right)\right)\\
\end{array}double f(double x, double y) {
double r18971742 = 1.0;
double r18971743 = x;
double r18971744 = y;
double r18971745 = r18971743 - r18971744;
double r18971746 = r18971742 - r18971744;
double r18971747 = r18971745 / r18971746;
double r18971748 = r18971742 - r18971747;
double r18971749 = log(r18971748);
double r18971750 = r18971742 - r18971749;
return r18971750;
}
double f(double x, double y) {
double r18971751 = x;
double r18971752 = y;
double r18971753 = r18971751 - r18971752;
double r18971754 = 1.0;
double r18971755 = r18971754 - r18971752;
double r18971756 = r18971753 / r18971755;
double r18971757 = 0.8581617207853955;
bool r18971758 = r18971756 <= r18971757;
double r18971759 = r18971754 - r18971756;
double r18971760 = sqrt(r18971759);
double r18971761 = log(r18971760);
double r18971762 = r18971761 + r18971761;
double r18971763 = r18971754 - r18971762;
double r18971764 = r18971751 / r18971752;
double r18971765 = r18971754 / r18971752;
double r18971766 = r18971764 - r18971765;
double r18971767 = fma(r18971764, r18971765, r18971766);
double r18971768 = log(r18971767);
double r18971769 = r18971754 - r18971768;
double r18971770 = r18971758 ? r18971763 : r18971769;
return r18971770;
}




Bits error versus x




Bits error versus y
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.8581617207853955Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied log-prod0.0
if 0.8581617207853955 < (/ (- x y) (- 1.0 y)) Initial program 59.3
Taylor expanded around inf 0.7
Simplified0.7
Final simplification0.2
herbie shell --seed 2019163 +o rules:numerics
(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))))))