\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -9603720562144241244067922519785472:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{elif}\;x \le 6.305809243265488292923253978118289242438 \cdot 10^{-10}:\\
\;\;\;\;\frac{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}}{x} \cdot e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r13002513 = x;
double r13002514 = y;
double r13002515 = r13002513 + r13002514;
double r13002516 = r13002513 / r13002515;
double r13002517 = log(r13002516);
double r13002518 = r13002513 * r13002517;
double r13002519 = exp(r13002518);
double r13002520 = r13002519 / r13002513;
return r13002520;
}
double f(double x, double y) {
double r13002521 = x;
double r13002522 = -9.603720562144241e+33;
bool r13002523 = r13002521 <= r13002522;
double r13002524 = y;
double r13002525 = -r13002524;
double r13002526 = exp(r13002525);
double r13002527 = r13002526 / r13002521;
double r13002528 = 6.305809243265488e-10;
bool r13002529 = r13002521 <= r13002528;
double r13002530 = cbrt(r13002521);
double r13002531 = r13002524 + r13002521;
double r13002532 = cbrt(r13002531);
double r13002533 = r13002530 / r13002532;
double r13002534 = log(r13002533);
double r13002535 = r13002521 * r13002534;
double r13002536 = exp(r13002535);
double r13002537 = r13002536 / r13002521;
double r13002538 = r13002535 + r13002535;
double r13002539 = exp(r13002538);
double r13002540 = r13002537 * r13002539;
double r13002541 = r13002529 ? r13002540 : r13002527;
double r13002542 = r13002523 ? r13002527 : r13002541;
return r13002542;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.8 |
| Herbie | 0.3 |
if x < -9.603720562144241e+33 or 6.305809243265488e-10 < x Initial program 11.4
Taylor expanded around inf 0.4
Simplified0.4
if -9.603720562144241e+33 < x < 6.305809243265488e-10Initial program 10.4
rmApplied *-un-lft-identity10.4
Applied add-cube-cbrt12.1
Applied add-cube-cbrt10.4
Applied times-frac10.4
Applied log-prod1.9
Applied distribute-lft-in1.9
Applied exp-sum1.9
Applied times-frac1.9
Simplified0.2
Final simplification0.3
herbie shell --seed 2019200 +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))