1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -270508391.61573327 \lor \neg \left(y \le 148253897.024537414\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{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 r419823 = 1.0;
double r419824 = x;
double r419825 = y;
double r419826 = r419824 - r419825;
double r419827 = r419823 - r419825;
double r419828 = r419826 / r419827;
double r419829 = r419823 - r419828;
double r419830 = log(r419829);
double r419831 = r419823 - r419830;
return r419831;
}
double f(double x, double y) {
double r419832 = y;
double r419833 = -270508391.61573327;
bool r419834 = r419832 <= r419833;
double r419835 = 148253897.0245374;
bool r419836 = r419832 <= r419835;
double r419837 = !r419836;
bool r419838 = r419834 || r419837;
double r419839 = 1.0;
double r419840 = exp(r419839);
double r419841 = x;
double r419842 = 2.0;
double r419843 = pow(r419832, r419842);
double r419844 = r419841 / r419843;
double r419845 = 1.0;
double r419846 = r419845 / r419832;
double r419847 = r419844 - r419846;
double r419848 = r419839 * r419847;
double r419849 = r419841 / r419832;
double r419850 = r419848 + r419849;
double r419851 = r419840 / r419850;
double r419852 = log(r419851);
double r419853 = r419841 - r419832;
double r419854 = r419839 - r419832;
double r419855 = r419853 / r419854;
double r419856 = r419839 - r419855;
double r419857 = r419840 / r419856;
double r419858 = log(r419857);
double r419859 = r419838 ? r419852 : r419858;
return r419859;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -270508391.61573327 or 148253897.0245374 < y Initial program 47.3
rmApplied add-log-exp47.3
Applied diff-log47.3
Taylor expanded around inf 0.2
Simplified0.2
if -270508391.61573327 < y < 148253897.0245374Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2020036
(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))))))