\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 11.69456786955556992779747815802693367004:\\
\;\;\;\;\frac{{\left(e^{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right)}^{\left(\sqrt[3]{x} \cdot \log \left(\frac{x}{x + y}\right)\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r19506954 = x;
double r19506955 = y;
double r19506956 = r19506954 + r19506955;
double r19506957 = r19506954 / r19506956;
double r19506958 = log(r19506957);
double r19506959 = r19506954 * r19506958;
double r19506960 = exp(r19506959);
double r19506961 = r19506960 / r19506954;
return r19506961;
}
double f(double x, double y) {
double r19506962 = x;
double r19506963 = -4.909420533601188e+97;
bool r19506964 = r19506962 <= r19506963;
double r19506965 = 1.0;
double r19506966 = y;
double r19506967 = exp(r19506966);
double r19506968 = r19506967 * r19506962;
double r19506969 = r19506965 / r19506968;
double r19506970 = 11.69456786955557;
bool r19506971 = r19506962 <= r19506970;
double r19506972 = cbrt(r19506962);
double r19506973 = r19506972 * r19506972;
double r19506974 = exp(r19506973);
double r19506975 = r19506962 + r19506966;
double r19506976 = r19506962 / r19506975;
double r19506977 = log(r19506976);
double r19506978 = r19506972 * r19506977;
double r19506979 = pow(r19506974, r19506978);
double r19506980 = r19506979 / r19506962;
double r19506981 = -r19506966;
double r19506982 = exp(r19506981);
double r19506983 = r19506982 / r19506962;
double r19506984 = r19506971 ? r19506980 : r19506983;
double r19506985 = r19506964 ? r19506969 : r19506984;
return r19506985;
}




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 < 11.69456786955557Initial program 11.0
rmApplied add-log-exp18.1
Applied exp-to-pow0.6
rmApplied add-cube-cbrt0.6
Applied exp-prod0.6
Applied pow-pow0.5
if 11.69456786955557 < x Initial program 9.3
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.3
herbie shell --seed 2019168 +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))