\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -4.909420533601188192839755443280075130357 \cdot 10^{97}:\\
\;\;\;\;\frac{1}{e^{y} \cdot x}\\
\mathbf{elif}\;x \le 7.112053666365072857047380239237099885941:\\
\;\;\;\;\frac{e^{x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r19794982 = x;
double r19794983 = y;
double r19794984 = r19794982 + r19794983;
double r19794985 = r19794982 / r19794984;
double r19794986 = log(r19794985);
double r19794987 = r19794982 * r19794986;
double r19794988 = exp(r19794987);
double r19794989 = r19794988 / r19794982;
return r19794989;
}
double f(double x, double y) {
double r19794990 = x;
double r19794991 = -4.909420533601188e+97;
bool r19794992 = r19794990 <= r19794991;
double r19794993 = 1.0;
double r19794994 = y;
double r19794995 = exp(r19794994);
double r19794996 = r19794995 * r19794990;
double r19794997 = r19794993 / r19794996;
double r19794998 = 7.112053666365073;
bool r19794999 = r19794990 <= r19794998;
double r19795000 = cbrt(r19794990);
double r19795001 = r19794990 + r19794994;
double r19795002 = cbrt(r19795001);
double r19795003 = r19795000 / r19795002;
double r19795004 = log(r19795003);
double r19795005 = r19795004 + r19795004;
double r19795006 = r19795004 + r19795005;
double r19795007 = r19794990 * r19795006;
double r19795008 = exp(r19795007);
double r19795009 = r19795008 / r19794990;
double r19795010 = -r19794994;
double r19795011 = exp(r19795010);
double r19795012 = r19795011 / r19794990;
double r19795013 = r19794999 ? r19795009 : r19795012;
double r19795014 = r19794992 ? r19794997 : r19795013;
return r19795014;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.2 |
|---|---|
| Target | 8.0 |
| Herbie | 0.3 |
if x < -4.909420533601188e+97Initial program 15.2
Taylor expanded around inf 0.0
Simplified0.0
rmApplied clear-num0.0
Simplified0.0
if -4.909420533601188e+97 < x < 7.112053666365073Initial program 11.0
rmApplied add-cube-cbrt16.2
Applied add-cube-cbrt11.0
Applied times-frac11.0
Applied log-prod2.4
Simplified0.5
if 7.112053666365073 < x Initial program 9.3
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.3
herbie shell --seed 2019168
(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))