\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le 1077.4618968781419 \lor \neg \left(y \le 4.93738979423122685 \cdot 10^{97}\right):\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)}}{x}\\
\end{array}double f(double x, double y) {
double r424408 = x;
double r424409 = y;
double r424410 = r424408 + r424409;
double r424411 = r424408 / r424410;
double r424412 = log(r424411);
double r424413 = r424408 * r424412;
double r424414 = exp(r424413);
double r424415 = r424414 / r424408;
return r424415;
}
double f(double x, double y) {
double r424416 = y;
double r424417 = 1077.461896878142;
bool r424418 = r424416 <= r424417;
double r424419 = 4.937389794231227e+97;
bool r424420 = r424416 <= r424419;
double r424421 = !r424420;
bool r424422 = r424418 || r424421;
double r424423 = x;
double r424424 = 2.0;
double r424425 = cbrt(r424423);
double r424426 = r424423 + r424416;
double r424427 = cbrt(r424426);
double r424428 = r424425 / r424427;
double r424429 = log(r424428);
double r424430 = r424424 * r424429;
double r424431 = r424423 * r424430;
double r424432 = r424423 * r424429;
double r424433 = r424431 + r424432;
double r424434 = exp(r424433);
double r424435 = r424434 / r424423;
double r424436 = expm1(r424425);
double r424437 = log1p(r424436);
double r424438 = r424437 / r424427;
double r424439 = log(r424438);
double r424440 = r424423 * r424439;
double r424441 = r424431 + r424440;
double r424442 = exp(r424441);
double r424443 = r424442 / r424423;
double r424444 = r424422 ? r424435 : r424443;
return r424444;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.6 |
|---|---|
| Target | 8.1 |
| Herbie | 5.2 |
if y < 1077.461896878142 or 4.937389794231227e+97 < y Initial program 9.2
rmApplied add-cube-cbrt28.3
Applied add-cube-cbrt9.2
Applied times-frac9.2
Applied log-prod4.7
Applied distribute-lft-in4.7
Simplified3.5
if 1077.461896878142 < y < 4.937389794231227e+97Initial program 36.4
rmApplied add-cube-cbrt22.3
Applied add-cube-cbrt36.4
Applied times-frac36.4
Applied log-prod33.8
Applied distribute-lft-in33.8
Simplified33.8
rmApplied log1p-expm1-u23.0
Final simplification5.2
herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:precision binary64
:herbie-target
(if (< y -3.7311844206647956e+94) (/ (exp (/ -1 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 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))