1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -212491914.1913111507892608642578125 \lor \neg \left(y \le 758763659.74992859363555908203125\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\mathsf{fma}\left(1, \frac{x}{{y}^{2}}, \frac{x}{y}\right) - \frac{1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r238040 = 1.0;
double r238041 = x;
double r238042 = y;
double r238043 = r238041 - r238042;
double r238044 = r238040 - r238042;
double r238045 = r238043 / r238044;
double r238046 = r238040 - r238045;
double r238047 = log(r238046);
double r238048 = r238040 - r238047;
return r238048;
}
double f(double x, double y) {
double r238049 = y;
double r238050 = -212491914.19131115;
bool r238051 = r238049 <= r238050;
double r238052 = 758763659.7499286;
bool r238053 = r238049 <= r238052;
double r238054 = !r238053;
bool r238055 = r238051 || r238054;
double r238056 = 1.0;
double r238057 = exp(r238056);
double r238058 = x;
double r238059 = 2.0;
double r238060 = pow(r238049, r238059);
double r238061 = r238058 / r238060;
double r238062 = r238058 / r238049;
double r238063 = fma(r238056, r238061, r238062);
double r238064 = r238056 / r238049;
double r238065 = r238063 - r238064;
double r238066 = r238057 / r238065;
double r238067 = log(r238066);
double r238068 = r238058 - r238049;
double r238069 = r238056 - r238049;
double r238070 = r238068 / r238069;
double r238071 = r238056 - r238070;
double r238072 = r238057 / r238071;
double r238073 = log(r238072);
double r238074 = r238055 ? r238067 : r238073;
return r238074;
}




Bits error versus x




Bits error versus y
| Original | 18.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -212491914.19131115 or 758763659.7499286 < y Initial program 46.8
rmApplied add-log-exp46.8
Applied diff-log46.8
Taylor expanded around inf 0.2
Simplified0.2
if -212491914.19131115 < y < 758763659.7499286Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019323 +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))))))