\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -4.120156288663160099262452246870941235987 \cdot 10^{50} \lor \neg \left(x \le 1.115898472191414701666743120923343257633 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{1}{e^{y} \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\\
\end{array}double f(double x, double y) {
double r973176 = x;
double r973177 = y;
double r973178 = r973176 + r973177;
double r973179 = r973176 / r973178;
double r973180 = log(r973179);
double r973181 = r973176 * r973180;
double r973182 = exp(r973181);
double r973183 = r973182 / r973176;
return r973183;
}
double f(double x, double y) {
double r973184 = x;
double r973185 = -4.12015628866316e+50;
bool r973186 = r973184 <= r973185;
double r973187 = 1.1158984721914147e-09;
bool r973188 = r973184 <= r973187;
double r973189 = !r973188;
bool r973190 = r973186 || r973189;
double r973191 = 1.0;
double r973192 = y;
double r973193 = exp(r973192);
double r973194 = r973193 * r973184;
double r973195 = r973191 / r973194;
double r973196 = 2.0;
double r973197 = cbrt(r973184);
double r973198 = r973184 + r973192;
double r973199 = cbrt(r973198);
double r973200 = r973197 / r973199;
double r973201 = log(r973200);
double r973202 = r973196 * r973201;
double r973203 = r973202 + r973201;
double r973204 = r973184 * r973203;
double r973205 = exp(r973204);
double r973206 = r973205 / r973184;
double r973207 = r973190 ? r973195 : r973206;
return r973207;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.1 |
|---|---|
| Target | 8.0 |
| Herbie | 0.4 |
if x < -4.12015628866316e+50 or 1.1158984721914147e-09 < x Initial program 11.7
Taylor expanded around inf 0.5
Simplified0.5
rmApplied clear-num0.6
Simplified0.5
if -4.12015628866316e+50 < x < 1.1158984721914147e-09Initial program 10.6
rmApplied add-cube-cbrt13.5
Applied add-cube-cbrt10.6
Applied times-frac10.6
Applied log-prod2.0
Simplified0.2
Final simplification0.4
herbie shell --seed 2019303
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:precision binary64
:herbie-target
(if (< y -3.73118442066479561e94) (/ (exp (/ -1 y)) x) (if (< y 2.81795924272828789e37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))