1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 3.27165990269578651523296592754768024042 \cdot 10^{-16}:\\
\;\;\;\;1 - \left(\log \left(\sqrt{\left(\sqrt[3]{1 - \frac{x - y}{1 - y}} \cdot \sqrt[3]{1 - \frac{x - y}{1 - y}}\right) \cdot \sqrt[3]{1 - \frac{x - y}{1 - y}}}\right) + \log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)\right)\\
\end{array}double f(double x, double y) {
double r414107 = 1.0;
double r414108 = x;
double r414109 = y;
double r414110 = r414108 - r414109;
double r414111 = r414107 - r414109;
double r414112 = r414110 / r414111;
double r414113 = r414107 - r414112;
double r414114 = log(r414113);
double r414115 = r414107 - r414114;
return r414115;
}
double f(double x, double y) {
double r414116 = x;
double r414117 = y;
double r414118 = r414116 - r414117;
double r414119 = 1.0;
double r414120 = r414119 - r414117;
double r414121 = r414118 / r414120;
double r414122 = 3.2716599026957865e-16;
bool r414123 = r414121 <= r414122;
double r414124 = r414119 - r414121;
double r414125 = cbrt(r414124);
double r414126 = r414125 * r414125;
double r414127 = r414126 * r414125;
double r414128 = sqrt(r414127);
double r414129 = log(r414128);
double r414130 = sqrt(r414124);
double r414131 = log(r414130);
double r414132 = r414129 + r414131;
double r414133 = r414119 - r414132;
double r414134 = 2.0;
double r414135 = pow(r414117, r414134);
double r414136 = r414116 / r414135;
double r414137 = 1.0;
double r414138 = r414137 / r414117;
double r414139 = r414136 - r414138;
double r414140 = r414116 / r414117;
double r414141 = fma(r414119, r414139, r414140);
double r414142 = log(r414141);
double r414143 = r414119 - r414142;
double r414144 = r414123 ? r414133 : r414143;
return r414144;
}




Bits error versus x




Bits error versus y
| Original | 18.9 |
|---|---|
| Target | 0.1 |
| Herbie | 1.5 |
if (/ (- x y) (- 1.0 y)) < 3.2716599026957865e-16Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied log-prod0.0
rmApplied add-cube-cbrt0.1
if 3.2716599026957865e-16 < (/ (- x y) (- 1.0 y)) Initial program 57.6
Taylor expanded around inf 4.4
Simplified4.4
Final simplification1.5
herbie shell --seed 2020001 +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))))))