1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -51178879.934393361 \lor \neg \left(y \le 53143023.8704946265\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\left(1 + \frac{1}{y}\right) \cdot \frac{x}{y} - \frac{1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{\frac{1 - y}{\sqrt[3]{x - y}}}\right)\\
\end{array}double f(double x, double y) {
double r992979 = 1.0;
double r992980 = x;
double r992981 = y;
double r992982 = r992980 - r992981;
double r992983 = r992979 - r992981;
double r992984 = r992982 / r992983;
double r992985 = r992979 - r992984;
double r992986 = log(r992985);
double r992987 = r992979 - r992986;
return r992987;
}
double f(double x, double y) {
double r992988 = y;
double r992989 = -51178879.93439336;
bool r992990 = r992988 <= r992989;
double r992991 = 53143023.87049463;
bool r992992 = r992988 <= r992991;
double r992993 = !r992992;
bool r992994 = r992990 || r992993;
double r992995 = 1.0;
double r992996 = exp(r992995);
double r992997 = 1.0;
double r992998 = r992995 / r992988;
double r992999 = r992997 + r992998;
double r993000 = x;
double r993001 = r993000 / r992988;
double r993002 = r992999 * r993001;
double r993003 = r993002 - r992998;
double r993004 = r992996 / r993003;
double r993005 = log(r993004);
double r993006 = r993000 - r992988;
double r993007 = cbrt(r993006);
double r993008 = r993007 * r993007;
double r993009 = r992995 - r992988;
double r993010 = r993009 / r993007;
double r993011 = r993008 / r993010;
double r993012 = r992995 - r993011;
double r993013 = log(r993012);
double r993014 = r992995 - r993013;
double r993015 = r992994 ? r993005 : r993014;
return r993015;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -51178879.93439336 or 53143023.87049463 < y Initial program 47.0
rmApplied add-log-exp47.0
Applied diff-log47.0
Taylor expanded around inf 0.2
Simplified0.2
if -51178879.93439336 < y < 53143023.87049463Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/l*0.1
Final simplification0.1
herbie shell --seed 2020047
(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))))))