Average Error: 11.5 → 6.4
Time: 5.2s
Precision: binary64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -5.949766666727802 \cdot 10^{+125}:\\ \;\;\;\;\frac{{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 2.5297358828475472 \cdot 10^{+17}:\\ \;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 2.7087781073527612 \cdot 10^{+166}:\\ \;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt{x}}{\sqrt{y + x}}\right)}^{x} \cdot {\left(\frac{\sqrt{x}}{\sqrt{y + x}}\right)}^{x}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \leq -5.949766666727802 \cdot 10^{+125}:\\
\;\;\;\;\frac{{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\

\mathbf{elif}\;y \leq 2.5297358828475472 \cdot 10^{+17}:\\
\;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\

\mathbf{elif}\;y \leq 2.7087781073527612 \cdot 10^{+166}:\\
\;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\

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

\end{array}
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 VAR;
	if ((y <= -5.949766666727802e+125)) {
		VAR = (((double) (((double) pow(((double) (((double) cbrt(x)) * ((double) cbrt(x)))), x)) * ((double) pow((((double) cbrt(x)) / ((double) (y + x))), x)))) / x);
	} else {
		double VAR_1;
		if ((y <= 2.5297358828475472e+17)) {
			VAR_1 = (((double) pow((x / ((double) (y + x))), x)) / x);
		} else {
			double VAR_2;
			if ((y <= 2.7087781073527612e+166)) {
				VAR_2 = ((double) log(((double) exp((((double) pow((x / ((double) (y + x))), x)) / x)))));
			} else {
				VAR_2 = (((double) (((double) pow((((double) sqrt(x)) / ((double) sqrt(((double) (y + x))))), x)) * ((double) pow((((double) sqrt(x)) / ((double) sqrt(((double) (y + x))))), x)))) / x);
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.5
Target8.0
Herbie6.4
\[\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 4 regimes
  2. if y < -5.94976666672780219e125

    1. Initial program 42.5

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified42.5

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity42.5

      \[\leadsto \frac{{\left(\frac{x}{\color{blue}{1 \cdot \left(x + y\right)}}\right)}^{x}}{x}\]
    5. Applied add-cube-cbrt42.5

      \[\leadsto \frac{{\left(\frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot \left(x + y\right)}\right)}^{x}}{x}\]
    6. Applied times-frac42.5

      \[\leadsto \frac{{\color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \frac{\sqrt[3]{x}}{x + y}\right)}}^{x}}{x}\]
    7. Applied unpow-prod-down11.6

      \[\leadsto \frac{\color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{x + y}\right)}^{x}}}{x}\]
    8. Simplified11.6

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

    if -5.94976666672780219e125 < y < 252973588284754720

    1. Initial program 2.3

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified2.3

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]

    if 252973588284754720 < y < 2.7087781073527612e166

    1. Initial program 35.9

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified35.9

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-log-exp23.5

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

    if 2.7087781073527612e166 < y

    1. Initial program 28.5

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified28.5

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt29.5

      \[\leadsto \frac{{\left(\frac{x}{\color{blue}{\sqrt{x + y} \cdot \sqrt{x + y}}}\right)}^{x}}{x}\]
    5. Applied add-sqr-sqrt30.3

      \[\leadsto \frac{{\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{x + y} \cdot \sqrt{x + y}}\right)}^{x}}{x}\]
    6. Applied times-frac30.3

      \[\leadsto \frac{{\color{blue}{\left(\frac{\sqrt{x}}{\sqrt{x + y}} \cdot \frac{\sqrt{x}}{\sqrt{x + y}}\right)}}^{x}}{x}\]
    7. Applied unpow-prod-down10.6

      \[\leadsto \frac{\color{blue}{{\left(\frac{\sqrt{x}}{\sqrt{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt{x}}{\sqrt{x + y}}\right)}^{x}}}{x}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification6.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.949766666727802 \cdot 10^{+125}:\\ \;\;\;\;\frac{{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 2.5297358828475472 \cdot 10^{+17}:\\ \;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 2.7087781073527612 \cdot 10^{+166}:\\ \;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt{x}}{\sqrt{y + x}}\right)}^{x} \cdot {\left(\frac{\sqrt{x}}{\sqrt{y + x}}\right)}^{x}}{x}\\ \end{array}\]

Reproduce

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