\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -9603720562144241244067922519785472:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{elif}\;x \le 6.305809243265488292923253978118289242438 \cdot 10^{-10}:\\
\;\;\;\;\frac{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}}{x} \cdot e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right) \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r18632464 = x;
double r18632465 = y;
double r18632466 = r18632464 + r18632465;
double r18632467 = r18632464 / r18632466;
double r18632468 = log(r18632467);
double r18632469 = r18632464 * r18632468;
double r18632470 = exp(r18632469);
double r18632471 = r18632470 / r18632464;
return r18632471;
}
double f(double x, double y) {
double r18632472 = x;
double r18632473 = -9.603720562144241e+33;
bool r18632474 = r18632472 <= r18632473;
double r18632475 = y;
double r18632476 = -r18632475;
double r18632477 = exp(r18632476);
double r18632478 = r18632477 / r18632472;
double r18632479 = 6.305809243265488e-10;
bool r18632480 = r18632472 <= r18632479;
double r18632481 = cbrt(r18632472);
double r18632482 = r18632475 + r18632472;
double r18632483 = cbrt(r18632482);
double r18632484 = r18632481 / r18632483;
double r18632485 = log(r18632484);
double r18632486 = r18632472 * r18632485;
double r18632487 = exp(r18632486);
double r18632488 = r18632487 / r18632472;
double r18632489 = r18632485 + r18632485;
double r18632490 = r18632489 * r18632472;
double r18632491 = exp(r18632490);
double r18632492 = r18632488 * r18632491;
double r18632493 = r18632480 ? r18632492 : r18632478;
double r18632494 = r18632474 ? r18632478 : r18632493;
return r18632494;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.8 |
| Herbie | 0.3 |
if x < -9.603720562144241e+33 or 6.305809243265488e-10 < x Initial program 11.4
Taylor expanded around inf 0.4
Simplified0.4
if -9.603720562144241e+33 < x < 6.305809243265488e-10Initial program 10.4
rmApplied *-un-lft-identity10.4
Applied add-cube-cbrt12.1
Applied add-cube-cbrt10.4
Applied times-frac10.4
Applied log-prod1.9
Applied distribute-lft-in1.9
Applied exp-sum1.9
Applied times-frac1.9
Simplified1.9
rmApplied log-prod0.2
Final simplification0.3
herbie shell --seed 2019200
(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))