Average Error: 11.0 → 11.0
Time: 5.2s
Precision: binary64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.1164790089715684 \cdot 10^{60}:\\ \;\;\;\;\frac{\left(\frac{2}{9} \cdot \left({x}^{4} \cdot \frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y \cdot y}\right) + \left(\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}} + \left(\frac{1}{3} \cdot \left(\frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y \cdot y} \cdot {x}^{3}\right) + \left(\left(x \cdot x\right) \cdot \frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y}\right) \cdot \frac{-2}{3}\right)\right)\right) \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \mathbf{elif}\;y \le -4.8879237528841516 \cdot 10^{-150}:\\ \;\;\;\;\frac{{\left(\frac{x}{x \cdot x - y \cdot y} \cdot \left(x - y\right)\right)}^{x}}{x}\\ \mathbf{elif}\;y \le 55.27842919862897:\\ \;\;\;\;\frac{{\left({\left(\frac{x}{y + x}\right)}^{\left(\sqrt{x}\right)}\right)}^{\left(\sqrt{x}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{y + x}{\sqrt[3]{x}}}\right)}^{x}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \le -1.1164790089715684 \cdot 10^{60}:\\
\;\;\;\;\frac{\left(\frac{2}{9} \cdot \left({x}^{4} \cdot \frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y \cdot y}\right) + \left(\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}} + \left(\frac{1}{3} \cdot \left(\frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y \cdot y} \cdot {x}^{3}\right) + \left(\left(x \cdot x\right) \cdot \frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y}\right) \cdot \frac{-2}{3}\right)\right)\right) \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\

\mathbf{elif}\;y \le -4.8879237528841516 \cdot 10^{-150}:\\
\;\;\;\;\frac{{\left(\frac{x}{x \cdot x - y \cdot y} \cdot \left(x - y\right)\right)}^{x}}{x}\\

\mathbf{elif}\;y \le 55.27842919862897:\\
\;\;\;\;\frac{{\left({\left(\frac{x}{y + x}\right)}^{\left(\sqrt{x}\right)}\right)}^{\left(\sqrt{x}\right)}}{x}\\

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

\end{array}
double code(double x, double y) {
	return ((double) (((double) exp(((double) (x * ((double) log(((double) (x / ((double) (x + y)))))))))) / x));
}
double code(double x, double y) {
	double VAR;
	if ((y <= -1.1164790089715684e+60)) {
		VAR = ((double) (((double) (((double) (((double) (0.2222222222222222 * ((double) (((double) pow(x, 4.0)) * ((double) (((double) cbrt(((double) pow(((double) exp(x)), ((double) (2.0 * ((double) (((double) log(x)) - ((double) log(y)))))))))) / ((double) (y * y)))))))) + ((double) (((double) cbrt(((double) pow(((double) exp(x)), ((double) (2.0 * ((double) (((double) log(x)) - ((double) log(y)))))))))) + ((double) (((double) (0.3333333333333333 * ((double) (((double) (((double) cbrt(((double) pow(((double) exp(x)), ((double) (2.0 * ((double) (((double) log(x)) - ((double) log(y)))))))))) / ((double) (y * y)))) * ((double) pow(x, 3.0)))))) + ((double) (((double) (((double) (x * x)) * ((double) (((double) cbrt(((double) pow(((double) exp(x)), ((double) (2.0 * ((double) (((double) log(x)) - ((double) log(y)))))))))) / y)))) * -0.6666666666666666)))))))) * ((double) pow(((double) (((double) cbrt(x)) / ((double) cbrt(((double) (y + x)))))), x)))) / x));
	} else {
		double VAR_1;
		if ((y <= -4.887923752884152e-150)) {
			VAR_1 = ((double) (((double) pow(((double) (((double) (x / ((double) (((double) (x * x)) - ((double) (y * y)))))) * ((double) (x - y)))), x)) / x));
		} else {
			double VAR_2;
			if ((y <= 55.27842919862897)) {
				VAR_2 = ((double) (((double) pow(((double) pow(((double) (x / ((double) (y + x)))), ((double) sqrt(x)))), ((double) sqrt(x)))) / x));
			} else {
				VAR_2 = ((double) (((double) pow(((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) / ((double) (((double) (y + x)) / ((double) cbrt(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.0
Target7.8
Herbie11.0
\[\begin{array}{l} \mathbf{if}\;y \lt -3.73118442066479561 \cdot 10^{94}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \mathbf{elif}\;y \lt 2.81795924272828789 \cdot 10^{37}:\\ \;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \lt 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 < -1.1164790089715684e60

    1. Initial program 36.0

      \[\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-cube-cbrt35.9

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

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

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

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

      \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x}} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    9. Taylor expanded around inf 63.8

      \[\leadsto \frac{\color{blue}{\left(\left(\frac{2}{9} \cdot \frac{{x}^{4} \cdot e^{\frac{1}{3} \cdot \left(\left(\log \left({x}^{2}\right) + 2 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right)}}{{y}^{2}} + \left(e^{\frac{1}{3} \cdot \left(\left(\log \left({x}^{2}\right) + 2 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right)} + \frac{1}{3} \cdot \frac{{x}^{3} \cdot e^{\frac{1}{3} \cdot \left(\left(\log \left({x}^{2}\right) + 2 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right)}}{{y}^{2}}\right)\right) - \frac{2}{3} \cdot \frac{{x}^{2} \cdot e^{\frac{1}{3} \cdot \left(\left(\log \left({x}^{2}\right) + 2 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right)}}{y}\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    10. Simplified3.0

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

    if -1.1164790089715684e60 < y < -4.8879237528841516e-150

    1. Initial program 2.2

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

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

      \[\leadsto \frac{{\left(\frac{x}{\color{blue}{\frac{x \cdot x - y \cdot y}{x - y}}}\right)}^{x}}{x}\]
    5. Applied associate-/r/22.1

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

    if -4.8879237528841516e-150 < y < 55.27842919862897

    1. Initial program 0.6

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

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

      \[\leadsto \frac{{\left(\frac{x}{x + y}\right)}^{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}}{x}\]
    5. Applied pow-unpow3.0

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

    if 55.27842919862897 < y

    1. Initial program 31.8

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

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

      \[\leadsto \frac{{\left(\frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{x + y}\right)}^{x}}{x}\]
    5. Applied associate-/l*23.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.1164790089715684 \cdot 10^{60}:\\ \;\;\;\;\frac{\left(\frac{2}{9} \cdot \left({x}^{4} \cdot \frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y \cdot y}\right) + \left(\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}} + \left(\frac{1}{3} \cdot \left(\frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y \cdot y} \cdot {x}^{3}\right) + \left(\left(x \cdot x\right) \cdot \frac{\sqrt[3]{{\left(e^{x}\right)}^{\left(2 \cdot \left(\log x - \log y\right)\right)}}}{y}\right) \cdot \frac{-2}{3}\right)\right)\right) \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \mathbf{elif}\;y \le -4.8879237528841516 \cdot 10^{-150}:\\ \;\;\;\;\frac{{\left(\frac{x}{x \cdot x - y \cdot y} \cdot \left(x - y\right)\right)}^{x}}{x}\\ \mathbf{elif}\;y \le 55.27842919862897:\\ \;\;\;\;\frac{{\left({\left(\frac{x}{y + x}\right)}^{\left(\sqrt{x}\right)}\right)}^{\left(\sqrt{x}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{y + x}{\sqrt[3]{x}}}\right)}^{x}}{x}\\ \end{array}\]

Reproduce

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