1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -79025762686.63672 \lor \neg \left(y \le 80304997.2964148968\right):\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - 1 \cdot \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(\log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right) + \log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right)\right)\\
\end{array}double f(double x, double y) {
double r347985 = 1.0;
double r347986 = x;
double r347987 = y;
double r347988 = r347986 - r347987;
double r347989 = r347985 - r347987;
double r347990 = r347988 / r347989;
double r347991 = r347985 - r347990;
double r347992 = log(r347991);
double r347993 = r347985 - r347992;
return r347993;
}
double f(double x, double y) {
double r347994 = y;
double r347995 = -79025762686.63672;
bool r347996 = r347994 <= r347995;
double r347997 = 80304997.2964149;
bool r347998 = r347994 <= r347997;
double r347999 = !r347998;
bool r348000 = r347996 || r347999;
double r348001 = 1.0;
double r348002 = x;
double r348003 = r348002 / r347994;
double r348004 = 2.0;
double r348005 = pow(r347994, r348004);
double r348006 = r348002 / r348005;
double r348007 = r348001 * r348006;
double r348008 = r348003 + r348007;
double r348009 = 1.0;
double r348010 = r348009 / r347994;
double r348011 = r348001 * r348010;
double r348012 = r348008 - r348011;
double r348013 = log(r348012);
double r348014 = r348001 - r348013;
double r348015 = r348002 - r347994;
double r348016 = r348001 - r347994;
double r348017 = r348015 / r348016;
double r348018 = r348001 - r348017;
double r348019 = sqrt(r348018);
double r348020 = log(r348019);
double r348021 = r348020 + r348020;
double r348022 = r348001 - r348021;
double r348023 = r348000 ? r348014 : r348022;
return r348023;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if y < -79025762686.63672 or 80304997.2964149 < y Initial program 46.9
rmApplied flip3--53.5
Simplified53.5
Taylor expanded around inf 0.1
if -79025762686.63672 < y < 80304997.2964149Initial program 0.2
rmApplied add-sqr-sqrt0.2
Applied log-prod0.2
Final simplification0.2
herbie shell --seed 2020057 +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))))))