\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -40676008707595812134875960694538240:\\
\;\;\;\;e^{-y} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \le 0.2043583175286355080313427379223867319524:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;e^{-y} \cdot \frac{1}{x}\\
\end{array}double f(double x, double y) {
double r15910381 = x;
double r15910382 = y;
double r15910383 = r15910381 + r15910382;
double r15910384 = r15910381 / r15910383;
double r15910385 = log(r15910384);
double r15910386 = r15910381 * r15910385;
double r15910387 = exp(r15910386);
double r15910388 = r15910387 / r15910381;
return r15910388;
}
double f(double x, double y) {
double r15910389 = x;
double r15910390 = -4.067600870759581e+34;
bool r15910391 = r15910389 <= r15910390;
double r15910392 = y;
double r15910393 = -r15910392;
double r15910394 = exp(r15910393);
double r15910395 = 1.0;
double r15910396 = r15910395 / r15910389;
double r15910397 = r15910394 * r15910396;
double r15910398 = 0.2043583175286355;
bool r15910399 = r15910389 <= r15910398;
double r15910400 = r15910399 ? r15910396 : r15910397;
double r15910401 = r15910391 ? r15910397 : r15910400;
return r15910401;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.6 |
| Herbie | 0.4 |
if x < -4.067600870759581e+34 or 0.2043583175286355 < x Initial program 11.2
Taylor expanded around inf 0.0
Simplified0.0
rmApplied div-inv0.0
if -4.067600870759581e+34 < x < 0.2043583175286355Initial program 10.6
Taylor expanded around inf 0.8
Final simplification0.4
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:herbie-target
(if (< y -3.7311844206647956e+94) (/ (exp (/ -1.0 y)) x) (if (< y 2.817959242728288e+37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e+178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1.0 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))