1.0 - \log \left(1.0 - \frac{x - y}{1.0 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1.0 - y} \le 0.8581617207853955:\\
\;\;\;\;1.0 - \left(\log \left(\sqrt{1.0 - \frac{x - y}{1.0 - y}}\right) + \log \left(\sqrt{1.0 - \frac{x - y}{1.0 - y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1.0 - \log \left(\mathsf{fma}\left(\frac{x}{y}, \frac{1.0}{y}, \frac{x}{y} - \frac{1.0}{y}\right)\right)\\
\end{array}double f(double x, double y) {
double r19036259 = 1.0;
double r19036260 = x;
double r19036261 = y;
double r19036262 = r19036260 - r19036261;
double r19036263 = r19036259 - r19036261;
double r19036264 = r19036262 / r19036263;
double r19036265 = r19036259 - r19036264;
double r19036266 = log(r19036265);
double r19036267 = r19036259 - r19036266;
return r19036267;
}
double f(double x, double y) {
double r19036268 = x;
double r19036269 = y;
double r19036270 = r19036268 - r19036269;
double r19036271 = 1.0;
double r19036272 = r19036271 - r19036269;
double r19036273 = r19036270 / r19036272;
double r19036274 = 0.8581617207853955;
bool r19036275 = r19036273 <= r19036274;
double r19036276 = r19036271 - r19036273;
double r19036277 = sqrt(r19036276);
double r19036278 = log(r19036277);
double r19036279 = r19036278 + r19036278;
double r19036280 = r19036271 - r19036279;
double r19036281 = r19036268 / r19036269;
double r19036282 = r19036271 / r19036269;
double r19036283 = r19036281 - r19036282;
double r19036284 = fma(r19036281, r19036282, r19036283);
double r19036285 = log(r19036284);
double r19036286 = r19036271 - r19036285;
double r19036287 = r19036275 ? r19036280 : r19036286;
return r19036287;
}




Bits error versus x




Bits error versus y
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.8581617207853955Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied log-prod0.0
if 0.8581617207853955 < (/ (- x y) (- 1.0 y)) Initial program 59.3
Taylor expanded around inf 0.7
Simplified0.7
Final simplification0.2
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))