1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -118579514.584518134593963623046875 \lor \neg \left(y \le 32110906.8722298182547092437744140625\right):\\
\;\;\;\;1 - \log \left(\left(\frac{1}{y} + 1\right) \cdot \frac{x}{y} - \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \left(x - y\right) \cdot \frac{1}{1 - y}\right)\\
\end{array}double f(double x, double y) {
double r258000 = 1.0;
double r258001 = x;
double r258002 = y;
double r258003 = r258001 - r258002;
double r258004 = r258000 - r258002;
double r258005 = r258003 / r258004;
double r258006 = r258000 - r258005;
double r258007 = log(r258006);
double r258008 = r258000 - r258007;
return r258008;
}
double f(double x, double y) {
double r258009 = y;
double r258010 = -118579514.58451813;
bool r258011 = r258009 <= r258010;
double r258012 = 32110906.87222982;
bool r258013 = r258009 <= r258012;
double r258014 = !r258013;
bool r258015 = r258011 || r258014;
double r258016 = 1.0;
double r258017 = r258016 / r258009;
double r258018 = 1.0;
double r258019 = r258017 + r258018;
double r258020 = x;
double r258021 = r258020 / r258009;
double r258022 = r258019 * r258021;
double r258023 = r258022 - r258017;
double r258024 = log(r258023);
double r258025 = r258016 - r258024;
double r258026 = r258020 - r258009;
double r258027 = r258016 - r258009;
double r258028 = r258018 / r258027;
double r258029 = r258026 * r258028;
double r258030 = r258016 - r258029;
double r258031 = log(r258030);
double r258032 = r258016 - r258031;
double r258033 = r258015 ? r258025 : r258032;
return r258033;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -118579514.58451813 or 32110906.87222982 < y Initial program 47.0
rmApplied div-inv45.8
Taylor expanded around inf 0.1
Simplified0.1
if -118579514.58451813 < y < 32110906.87222982Initial program 0.1
rmApplied div-inv0.1
Final simplification0.1
herbie shell --seed 2019322 +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))))))