1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -589339982.767086387 \lor \neg \left(y \le 146835981.479329318\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{\sqrt{1 - \frac{x - y}{1 - y}} \cdot \sqrt{1 - \frac{x - y}{1 - y}}}\right)\\
\end{array}double f(double x, double y) {
double r418338 = 1.0;
double r418339 = x;
double r418340 = y;
double r418341 = r418339 - r418340;
double r418342 = r418338 - r418340;
double r418343 = r418341 / r418342;
double r418344 = r418338 - r418343;
double r418345 = log(r418344);
double r418346 = r418338 - r418345;
return r418346;
}
double f(double x, double y) {
double r418347 = y;
double r418348 = -589339982.7670864;
bool r418349 = r418347 <= r418348;
double r418350 = 146835981.47932932;
bool r418351 = r418347 <= r418350;
double r418352 = !r418351;
bool r418353 = r418349 || r418352;
double r418354 = 1.0;
double r418355 = x;
double r418356 = 2.0;
double r418357 = pow(r418347, r418356);
double r418358 = r418355 / r418357;
double r418359 = 1.0;
double r418360 = r418359 / r418347;
double r418361 = r418358 - r418360;
double r418362 = r418354 * r418361;
double r418363 = r418355 / r418347;
double r418364 = r418362 + r418363;
double r418365 = log(r418364);
double r418366 = r418354 - r418365;
double r418367 = exp(r418354);
double r418368 = r418355 - r418347;
double r418369 = r418354 - r418347;
double r418370 = r418368 / r418369;
double r418371 = r418354 - r418370;
double r418372 = sqrt(r418371);
double r418373 = r418372 * r418372;
double r418374 = r418367 / r418373;
double r418375 = log(r418374);
double r418376 = r418353 ? r418366 : r418375;
return r418376;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -589339982.7670864 or 146835981.47932932 < y Initial program 46.9
Taylor expanded around inf 0.1
Simplified0.1
if -589339982.7670864 < y < 146835981.47932932Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
rmApplied add-sqr-sqrt0.1
Final simplification0.1
herbie shell --seed 2020024
(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))))))