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 r353221 = 1.0;
double r353222 = x;
double r353223 = y;
double r353224 = r353222 - r353223;
double r353225 = r353221 - r353223;
double r353226 = r353224 / r353225;
double r353227 = r353221 - r353226;
double r353228 = log(r353227);
double r353229 = r353221 - r353228;
return r353229;
}
double f(double x, double y) {
double r353230 = x;
double r353231 = y;
double r353232 = r353230 - r353231;
double r353233 = 1.0;
double r353234 = r353233 - r353231;
double r353235 = r353232 / r353234;
double r353236 = 3.2716599026957865e-16;
bool r353237 = r353235 <= r353236;
double r353238 = r353233 - r353235;
double r353239 = cbrt(r353238);
double r353240 = r353239 * r353239;
double r353241 = r353240 * r353239;
double r353242 = sqrt(r353241);
double r353243 = log(r353242);
double r353244 = sqrt(r353238);
double r353245 = log(r353244);
double r353246 = r353243 + r353245;
double r353247 = r353233 - r353246;
double r353248 = 2.0;
double r353249 = pow(r353231, r353248);
double r353250 = r353230 / r353249;
double r353251 = 1.0;
double r353252 = r353251 / r353231;
double r353253 = r353250 - r353252;
double r353254 = r353230 / r353231;
double r353255 = fma(r353233, r353253, r353254);
double r353256 = log(r353255);
double r353257 = r353233 - r353256;
double r353258 = r353237 ? r353247 : r353257;
return r353258;
}




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))))))