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 r214432 = 1.0;
double r214433 = x;
double r214434 = y;
double r214435 = r214433 - r214434;
double r214436 = r214432 - r214434;
double r214437 = r214435 / r214436;
double r214438 = r214432 - r214437;
double r214439 = log(r214438);
double r214440 = r214432 - r214439;
return r214440;
}
double f(double x, double y) {
double r214441 = y;
double r214442 = -212491914.19131115;
bool r214443 = r214441 <= r214442;
double r214444 = 758763659.7499286;
bool r214445 = r214441 <= r214444;
double r214446 = !r214445;
bool r214447 = r214443 || r214446;
double r214448 = 1.0;
double r214449 = exp(r214448);
double r214450 = x;
double r214451 = 2.0;
double r214452 = pow(r214441, r214451);
double r214453 = r214450 / r214452;
double r214454 = r214450 / r214441;
double r214455 = fma(r214448, r214453, r214454);
double r214456 = r214448 / r214441;
double r214457 = r214455 - r214456;
double r214458 = r214449 / r214457;
double r214459 = log(r214458);
double r214460 = r214450 - r214441;
double r214461 = r214448 - r214441;
double r214462 = r214460 / r214461;
double r214463 = r214448 - r214462;
double r214464 = r214449 / r214463;
double r214465 = log(r214464);
double r214466 = r214447 ? r214459 : r214465;
return r214466;
}




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))))))