\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -338166549708266081878016:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{elif}\;x \le 5.105764663642184685065153471050791722519 \cdot 10^{-5}:\\
\;\;\;\;\frac{e^{x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{\frac{x}{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r25902462 = x;
double r25902463 = y;
double r25902464 = r25902462 + r25902463;
double r25902465 = r25902462 / r25902464;
double r25902466 = log(r25902465);
double r25902467 = r25902462 * r25902466;
double r25902468 = exp(r25902467);
double r25902469 = r25902468 / r25902462;
return r25902469;
}
double f(double x, double y) {
double r25902470 = x;
double r25902471 = -3.381665497082661e+23;
bool r25902472 = r25902470 <= r25902471;
double r25902473 = y;
double r25902474 = -r25902473;
double r25902475 = exp(r25902474);
double r25902476 = r25902475 / r25902470;
double r25902477 = 5.105764663642185e-05;
bool r25902478 = r25902470 <= r25902477;
double r25902479 = cbrt(r25902470);
double r25902480 = r25902470 + r25902473;
double r25902481 = cbrt(r25902480);
double r25902482 = r25902479 / r25902481;
double r25902483 = log(r25902482);
double r25902484 = r25902483 + r25902483;
double r25902485 = r25902470 * r25902484;
double r25902486 = exp(r25902485);
double r25902487 = r25902470 * r25902483;
double r25902488 = exp(r25902487);
double r25902489 = r25902470 / r25902488;
double r25902490 = r25902486 / r25902489;
double r25902491 = r25902478 ? r25902490 : r25902476;
double r25902492 = r25902472 ? r25902476 : r25902491;
return r25902492;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.6 |
|---|---|
| Target | 8.2 |
| Herbie | 0.2 |
if x < -3.381665497082661e+23 or 5.105764663642185e-05 < x Initial program 11.6
Taylor expanded around inf 0.3
Simplified0.3
if -3.381665497082661e+23 < x < 5.105764663642185e-05Initial program 11.6
rmApplied add-cube-cbrt12.4
Applied add-cube-cbrt11.6
Applied times-frac11.6
Applied log-prod2.3
Applied distribute-lft-in2.3
Applied exp-sum2.3
Applied associate-/l*2.3
rmApplied times-frac2.3
Applied log-prod0.1
Final simplification0.2
herbie shell --seed 2019174 +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))