\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le 526918.3282767582:\\
\;\;\;\;\frac{e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)\right) \cdot x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(\log \left(\frac{\left(\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right) + \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)\right)}}{x}\\
\end{array}double f(double x, double y) {
double r7112470 = x;
double r7112471 = y;
double r7112472 = r7112470 + r7112471;
double r7112473 = r7112470 / r7112472;
double r7112474 = log(r7112473);
double r7112475 = r7112470 * r7112474;
double r7112476 = exp(r7112475);
double r7112477 = r7112476 / r7112470;
return r7112477;
}
double f(double x, double y) {
double r7112478 = y;
double r7112479 = 526918.3282767582;
bool r7112480 = r7112478 <= r7112479;
double r7112481 = x;
double r7112482 = cbrt(r7112481);
double r7112483 = r7112481 + r7112478;
double r7112484 = cbrt(r7112483);
double r7112485 = r7112482 / r7112484;
double r7112486 = log(r7112485);
double r7112487 = r7112486 + r7112486;
double r7112488 = r7112486 + r7112487;
double r7112489 = r7112488 * r7112481;
double r7112490 = exp(r7112489);
double r7112491 = r7112490 / r7112481;
double r7112492 = /* ERROR: no posit support in C */;
double r7112493 = /* ERROR: no posit support in C */;
double r7112494 = r7112493 / r7112484;
double r7112495 = log(r7112494);
double r7112496 = r7112495 + r7112487;
double r7112497 = r7112481 * r7112496;
double r7112498 = exp(r7112497);
double r7112499 = r7112498 / r7112481;
double r7112500 = r7112480 ? r7112491 : r7112499;
return r7112500;
}




Bits error versus x




Bits error versus y
| Original | 11.1 |
|---|---|
| Target | 7.4 |
| Herbie | 3.8 |
if y < 526918.3282767582Initial program 4.4
rmApplied add-cube-cbrt28.0
Applied add-cube-cbrt4.4
Applied times-frac4.4
Applied log-prod1.6
rmApplied times-frac1.6
Applied log-prod1.0
if 526918.3282767582 < y Initial program 33.0
rmApplied add-cube-cbrt24.4
Applied add-cube-cbrt33.1
Applied times-frac33.1
Applied log-prod23.8
rmApplied times-frac23.8
Applied log-prod21.6
rmApplied insert-posit1613.0
Final simplification3.8
herbie shell --seed 2019156 +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 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))