Average Error: 11.0 → 4.5
Time: 5.4s
Precision: binary64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \leq 78554065061.35825 \lor \neg \left(y \leq 5.595107226688032 \cdot 10^{+204}\right):\\ \;\;\;\;\frac{{\left({\left(\frac{x}{y + x}\right)}^{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)}^{\left(\log \left(e^{\sqrt[3]{x}}\right)\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\right)}^{3}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \leq 78554065061.35825 \lor \neg \left(y \leq 5.595107226688032 \cdot 10^{+204}\right):\\
\;\;\;\;\frac{{\left({\left(\frac{x}{y + x}\right)}^{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)}^{\left(\log \left(e^{\sqrt[3]{x}}\right)\right)}}{x}\\

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\right)}^{3}}\\

\end{array}
(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
(FPCore (x y)
 :precision binary64
 (if (or (<= y 78554065061.35825) (not (<= y 5.595107226688032e+204)))
   (/ (pow (pow (/ x (+ y x)) (* (cbrt x) (cbrt x))) (log (exp (cbrt x)))) x)
   (cbrt (pow (/ (pow (/ x (+ y x)) x) x) 3.0))))
double code(double x, double y) {
	return (((double) exp(((double) (x * ((double) log((x / ((double) (x + y))))))))) / x);
}
double code(double x, double y) {
	double tmp;
	if (((y <= 78554065061.35825) || !(y <= 5.595107226688032e+204))) {
		tmp = (((double) pow(((double) pow((x / ((double) (y + x))), ((double) (((double) cbrt(x)) * ((double) cbrt(x)))))), ((double) log(((double) exp(((double) cbrt(x)))))))) / x);
	} else {
		tmp = ((double) cbrt(((double) pow((((double) pow((x / ((double) (y + x))), x)) / x), 3.0))));
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.0
Target7.8
Herbie4.5
\[\begin{array}{l} \mathbf{if}\;y < -3.7311844206647956 \cdot 10^{+94}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \mathbf{elif}\;y < 2.817959242728288 \cdot 10^{+37}:\\ \;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y < 2.347387415166998 \cdot 10^{+178}:\\ \;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if y < 78554065061.358246 or 5.5951072266880319e204 < y

    1. Initial program Error: 6.7 bits

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. SimplifiedError: 6.7 bits

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 6.7 bits

      \[\leadsto \frac{{\left(\frac{x}{x + y}\right)}^{\color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)}}}{x}\]
    5. Applied pow-unpowError: 6.7 bits

      \[\leadsto \frac{\color{blue}{{\left({\left(\frac{x}{x + y}\right)}^{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)}^{\left(\sqrt[3]{x}\right)}}}{x}\]
    6. Using strategy rm
    7. Applied add-log-expError: 1.9 bits

      \[\leadsto \frac{{\left({\left(\frac{x}{x + y}\right)}^{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)}^{\color{blue}{\left(\log \left(e^{\sqrt[3]{x}}\right)\right)}}}{x}\]

    if 78554065061.358246 < y < 5.5951072266880319e204

    1. Initial program Error: 34.4 bits

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. SimplifiedError: 34.3 bits

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-cbrt-cubeError: 18.2 bits

      \[\leadsto \frac{{\left(\frac{x}{x + y}\right)}^{x}}{\color{blue}{\sqrt[3]{\left(x \cdot x\right) \cdot x}}}\]
    5. Applied add-cbrt-cubeError: 18.3 bits

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left({\left(\frac{x}{x + y}\right)}^{x} \cdot {\left(\frac{x}{x + y}\right)}^{x}\right) \cdot {\left(\frac{x}{x + y}\right)}^{x}}}}{\sqrt[3]{\left(x \cdot x\right) \cdot x}}\]
    6. Applied cbrt-undivError: 18.4 bits

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\left({\left(\frac{x}{x + y}\right)}^{x} \cdot {\left(\frac{x}{x + y}\right)}^{x}\right) \cdot {\left(\frac{x}{x + y}\right)}^{x}}{\left(x \cdot x\right) \cdot x}}}\]
    7. SimplifiedError: 18.5 bits

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}\right)}^{3}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplificationError: 4.5 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 78554065061.35825 \lor \neg \left(y \leq 5.595107226688032 \cdot 10^{+204}\right):\\ \;\;\;\;\frac{{\left({\left(\frac{x}{y + x}\right)}^{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)}^{\left(\log \left(e^{\sqrt[3]{x}}\right)\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\right)}^{3}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020203 
(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))