\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 r274295 = x;
double r274296 = y;
double r274297 = r274295 + r274296;
double r274298 = r274295 / r274297;
double r274299 = log(r274298);
double r274300 = r274295 * r274299;
double r274301 = exp(r274300);
double r274302 = r274301 / r274295;
return r274302;
}
double f(double x, double y) {
double r274303 = x;
double r274304 = -4.12015628866316e+50;
bool r274305 = r274303 <= r274304;
double r274306 = 1.1158984721914147e-09;
bool r274307 = r274303 <= r274306;
double r274308 = !r274307;
bool r274309 = r274305 || r274308;
double r274310 = 1.0;
double r274311 = y;
double r274312 = exp(r274311);
double r274313 = r274312 * r274303;
double r274314 = r274310 / r274313;
double r274315 = 2.0;
double r274316 = cbrt(r274303);
double r274317 = r274303 + r274311;
double r274318 = cbrt(r274317);
double r274319 = r274316 / r274318;
double r274320 = log(r274319);
double r274321 = r274315 * r274320;
double r274322 = r274321 + r274320;
double r274323 = r274303 * r274322;
double r274324 = exp(r274323);
double r274325 = r274324 / r274303;
double r274326 = r274309 ? r274314 : r274325;
return r274326;
}




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))