\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \leq -9.58411435489314 \lor \neg \left(x \leq 6.240856440186883\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{x}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\end{array}(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
(FPCore (x y)
:precision binary64
(if (or (<= x -9.58411435489314) (not (<= x 6.240856440186883)))
(/ 1.0 (* x (exp y)))
(/
(*
(pow (/ 1.0 (* (cbrt (+ x y)) (cbrt (+ x y)))) x)
(pow (/ x (cbrt (+ x y))) x))
x)))double code(double x, double y) {
return exp(x * log(x / (x + y))) / x;
}
double code(double x, double y) {
double tmp;
if ((x <= -9.58411435489314) || !(x <= 6.240856440186883)) {
tmp = 1.0 / (x * exp(y));
} else {
tmp = (pow((1.0 / (cbrt(x + y) * cbrt(x + y))), x) * pow((x / cbrt(x + y)), x)) / x;
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.8 |
| Herbie | 1.4 |
if x < -9.58423 or 6.24084 < x Initial program 10.9
Simplified10.9
rmApplied div-inv_binary64_442710.9
Taylor expanded around inf 0.0
rmApplied neg-sub0_binary64_44320.0
Applied exp-diff_binary64_43870.0
Applied frac-times_binary64_44180.0
Simplified0.0
Simplified0.0
if -9.58423 < x < 6.24084Initial program 10.9
Simplified10.9
rmApplied add-cube-cbrt_binary64_439710.9
Applied *-un-lft-identity_binary64_442610.9
Applied times-frac_binary64_442110.9
Applied unpow-prod-down_binary64_43612.9
Final simplification1.4
herbie shell --seed 2020231
(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.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))