1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -339938991.337108433 \lor \neg \left(y \le 19835852.986995392\right):\\
\;\;\;\;\log \left(\frac{\sqrt{e^{1}}}{\mathsf{fma}\left(1, \frac{x}{{y}^{2}} \cdot \sqrt{e^{-1}}, \frac{x}{y} \cdot \sqrt{e^{-1}}\right) - \left(\sqrt{e^{-1}} \cdot \frac{1}{y}\right) \cdot 1}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{\sqrt{e^{1}}}{\frac{1 - \frac{x - y}{1 - y}}{\sqrt{e^{1}}}}\right)\\
\end{array}double f(double x, double y) {
double r522516 = 1.0;
double r522517 = x;
double r522518 = y;
double r522519 = r522517 - r522518;
double r522520 = r522516 - r522518;
double r522521 = r522519 / r522520;
double r522522 = r522516 - r522521;
double r522523 = log(r522522);
double r522524 = r522516 - r522523;
return r522524;
}
double f(double x, double y) {
double r522525 = y;
double r522526 = -339938991.33710843;
bool r522527 = r522525 <= r522526;
double r522528 = 19835852.98699539;
bool r522529 = r522525 <= r522528;
double r522530 = !r522529;
bool r522531 = r522527 || r522530;
double r522532 = 1.0;
double r522533 = exp(r522532);
double r522534 = sqrt(r522533);
double r522535 = x;
double r522536 = 2.0;
double r522537 = pow(r522525, r522536);
double r522538 = r522535 / r522537;
double r522539 = -r522532;
double r522540 = exp(r522539);
double r522541 = sqrt(r522540);
double r522542 = r522538 * r522541;
double r522543 = r522535 / r522525;
double r522544 = r522543 * r522541;
double r522545 = fma(r522532, r522542, r522544);
double r522546 = 1.0;
double r522547 = r522546 / r522525;
double r522548 = r522541 * r522547;
double r522549 = r522548 * r522532;
double r522550 = r522545 - r522549;
double r522551 = r522534 / r522550;
double r522552 = log(r522551);
double r522553 = r522535 - r522525;
double r522554 = r522532 - r522525;
double r522555 = r522553 / r522554;
double r522556 = r522532 - r522555;
double r522557 = r522556 / r522534;
double r522558 = r522534 / r522557;
double r522559 = log(r522558);
double r522560 = r522531 ? r522552 : r522559;
return r522560;
}




Bits error versus x




Bits error versus y
| Original | 18.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -339938991.33710843 or 19835852.98699539 < y Initial program 47.2
rmApplied add-log-exp47.2
Applied diff-log47.2
rmApplied add-sqr-sqrt47.2
Applied associate-/l*47.2
Taylor expanded around inf 0.1
Simplified0.1
if -339938991.33710843 < y < 19835852.98699539Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
rmApplied add-sqr-sqrt0.1
Applied associate-/l*0.1
Final simplification0.1
herbie shell --seed 2020043 +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))))))