1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.99781943200392309:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}}\right)\\
\end{array}double f(double x, double y) {
double r413192 = 1.0;
double r413193 = x;
double r413194 = y;
double r413195 = r413193 - r413194;
double r413196 = r413192 - r413194;
double r413197 = r413195 / r413196;
double r413198 = r413192 - r413197;
double r413199 = log(r413198);
double r413200 = r413192 - r413199;
return r413200;
}
double f(double x, double y) {
double r413201 = x;
double r413202 = y;
double r413203 = r413201 - r413202;
double r413204 = 1.0;
double r413205 = r413204 - r413202;
double r413206 = r413203 / r413205;
double r413207 = 0.9978194320039231;
bool r413208 = r413206 <= r413207;
double r413209 = exp(r413204);
double r413210 = r413204 - r413206;
double r413211 = r413209 / r413210;
double r413212 = log(r413211);
double r413213 = 2.0;
double r413214 = pow(r413202, r413213);
double r413215 = r413201 / r413214;
double r413216 = 1.0;
double r413217 = r413216 / r413202;
double r413218 = r413215 - r413217;
double r413219 = r413204 * r413218;
double r413220 = r413201 / r413202;
double r413221 = r413219 + r413220;
double r413222 = r413209 / r413221;
double r413223 = log(r413222);
double r413224 = r413208 ? r413212 : r413223;
return r413224;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9978194320039231Initial program 0.0
rmApplied add-log-exp0.0
Applied diff-log0.0
if 0.9978194320039231 < (/ (- x y) (- 1.0 y)) Initial program 61.5
rmApplied add-log-exp61.5
Applied diff-log61.5
Taylor expanded around inf 0.7
Simplified0.7
Final simplification0.2
herbie shell --seed 2020039
(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))))))