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}}}{\left(\frac{\sqrt{e^{-1}} \cdot x}{y} + \left(1 \cdot \sqrt{e^{-1}}\right) \cdot \frac{x}{{y}^{2}}\right) - \frac{1 \cdot \sqrt{e^{-1}}}{y}}\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 r408581 = 1.0;
double r408582 = x;
double r408583 = y;
double r408584 = r408582 - r408583;
double r408585 = r408581 - r408583;
double r408586 = r408584 / r408585;
double r408587 = r408581 - r408586;
double r408588 = log(r408587);
double r408589 = r408581 - r408588;
return r408589;
}
double f(double x, double y) {
double r408590 = y;
double r408591 = -339938991.33710843;
bool r408592 = r408590 <= r408591;
double r408593 = 19835852.98699539;
bool r408594 = r408590 <= r408593;
double r408595 = !r408594;
bool r408596 = r408592 || r408595;
double r408597 = 1.0;
double r408598 = exp(r408597);
double r408599 = sqrt(r408598);
double r408600 = -r408597;
double r408601 = exp(r408600);
double r408602 = sqrt(r408601);
double r408603 = x;
double r408604 = r408602 * r408603;
double r408605 = r408604 / r408590;
double r408606 = r408597 * r408602;
double r408607 = 2.0;
double r408608 = pow(r408590, r408607);
double r408609 = r408603 / r408608;
double r408610 = r408606 * r408609;
double r408611 = r408605 + r408610;
double r408612 = r408606 / r408590;
double r408613 = r408611 - r408612;
double r408614 = r408599 / r408613;
double r408615 = log(r408614);
double r408616 = r408603 - r408590;
double r408617 = r408597 - r408590;
double r408618 = r408616 / r408617;
double r408619 = r408597 - r408618;
double r408620 = r408619 / r408599;
double r408621 = r408599 / r408620;
double r408622 = log(r408621);
double r408623 = r408596 ? r408615 : r408622;
return r408623;
}




Bits error versus x




Bits error versus y
Results
| 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
(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))))))