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 r333365 = 1.0;
double r333366 = x;
double r333367 = y;
double r333368 = r333366 - r333367;
double r333369 = r333365 - r333367;
double r333370 = r333368 / r333369;
double r333371 = r333365 - r333370;
double r333372 = log(r333371);
double r333373 = r333365 - r333372;
return r333373;
}
double f(double x, double y) {
double r333374 = x;
double r333375 = y;
double r333376 = r333374 - r333375;
double r333377 = 1.0;
double r333378 = r333377 - r333375;
double r333379 = r333376 / r333378;
double r333380 = 3.2716599026957865e-16;
bool r333381 = r333379 <= r333380;
double r333382 = r333377 - r333379;
double r333383 = cbrt(r333382);
double r333384 = r333383 * r333383;
double r333385 = r333384 * r333383;
double r333386 = sqrt(r333385);
double r333387 = log(r333386);
double r333388 = sqrt(r333382);
double r333389 = log(r333388);
double r333390 = r333387 + r333389;
double r333391 = r333377 - r333390;
double r333392 = 2.0;
double r333393 = pow(r333375, r333392);
double r333394 = r333374 / r333393;
double r333395 = 1.0;
double r333396 = r333395 / r333375;
double r333397 = r333394 - r333396;
double r333398 = r333374 / r333375;
double r333399 = fma(r333377, r333397, r333398);
double r333400 = log(r333399);
double r333401 = r333377 - r333400;
double r333402 = r333381 ? r333391 : r333401;
return r333402;
}




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