1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -79025762686.63672:\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{elif}\;y \le 4.14547202165829592 \cdot 10^{23}:\\
\;\;\;\;1 - \left(\log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right) + \log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 \cdot \frac{\frac{-\frac{1}{y}}{y} + \frac{x}{\frac{{y}^{4}}{x}}}{\frac{x}{{y}^{2}} + \frac{1}{y}} + \frac{x}{y}\right)\\
\end{array}double f(double x, double y) {
double r460147 = 1.0;
double r460148 = x;
double r460149 = y;
double r460150 = r460148 - r460149;
double r460151 = r460147 - r460149;
double r460152 = r460150 / r460151;
double r460153 = r460147 - r460152;
double r460154 = log(r460153);
double r460155 = r460147 - r460154;
return r460155;
}
double f(double x, double y) {
double r460156 = y;
double r460157 = -79025762686.63672;
bool r460158 = r460156 <= r460157;
double r460159 = 1.0;
double r460160 = x;
double r460161 = 2.0;
double r460162 = pow(r460156, r460161);
double r460163 = r460160 / r460162;
double r460164 = 1.0;
double r460165 = r460164 / r460156;
double r460166 = r460163 - r460165;
double r460167 = r460159 * r460166;
double r460168 = r460160 / r460156;
double r460169 = r460167 + r460168;
double r460170 = log(r460169);
double r460171 = r460159 - r460170;
double r460172 = 4.145472021658296e+23;
bool r460173 = r460156 <= r460172;
double r460174 = r460160 - r460156;
double r460175 = r460159 - r460156;
double r460176 = r460174 / r460175;
double r460177 = r460159 - r460176;
double r460178 = sqrt(r460177);
double r460179 = log(r460178);
double r460180 = r460179 + r460179;
double r460181 = r460159 - r460180;
double r460182 = -r460165;
double r460183 = r460182 / r460156;
double r460184 = 4.0;
double r460185 = pow(r460156, r460184);
double r460186 = r460185 / r460160;
double r460187 = r460160 / r460186;
double r460188 = r460183 + r460187;
double r460189 = r460163 + r460165;
double r460190 = r460188 / r460189;
double r460191 = r460159 * r460190;
double r460192 = r460191 + r460168;
double r460193 = log(r460192);
double r460194 = r460159 - r460193;
double r460195 = r460173 ? r460181 : r460194;
double r460196 = r460158 ? r460171 : r460195;
return r460196;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
if y < -79025762686.63672Initial program 52.6
Taylor expanded around inf 0.1
Simplified0.1
if -79025762686.63672 < y < 4.145472021658296e+23Initial program 0.2
rmApplied add-sqr-sqrt0.2
Applied log-prod0.2
if 4.145472021658296e+23 < y Initial program 32.5
Taylor expanded around inf 0.0
Simplified0.0
rmApplied flip--1.8
Simplified1.8
Final simplification0.3
herbie shell --seed 2020057
(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))))))