Average Error: 11.6 → 8.0
Time: 5.8s
Precision: binary64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \le 562.72914128011621 \lor \neg \left(y \le 1.31329328247722981 \cdot 10^{62}\right) \land y \le 5.26434816177796769 \cdot 10^{115}:\\ \;\;\;\;\frac{{1}^{\left(\sqrt[3]{x}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \le 562.72914128011621 \lor \neg \left(y \le 1.31329328247722981 \cdot 10^{62}\right) \land y \le 5.26434816177796769 \cdot 10^{115}:\\
\;\;\;\;\frac{{1}^{\left(\sqrt[3]{x}\right)}}{x}\\

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

\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 <= 562.7291412801162) || (!(y <= 1.3132932824772298e+62) && (y <= 5.264348161777968e+115)))) {
		VAR = ((double) (((double) pow(1.0, ((double) cbrt(x)))) / x));
	} else {
		VAR = ((double) log(((double) exp(((double) (((double) pow(((double) (x / ((double) (y + x)))), x)) / x))))));
	}
	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.6
Target8.0
Herbie8.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 2 regimes
  2. if y < 562.72914128011621 or 1.31329328247722981e62 < y < 5.26434816177796769e115

    1. Initial program 6.3

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

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

      \[\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-unpow6.3

      \[\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. Taylor expanded around inf 36.3

      \[\leadsto \frac{{\color{blue}{\left(e^{\log 1 \cdot e^{\frac{1}{3} \cdot \left(\log 1 - 2 \cdot \log \left(\frac{1}{x}\right)\right)}}\right)}}^{\left(\sqrt[3]{x}\right)}}{x}\]
    7. Simplified3.3

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

    if 562.72914128011621 < y < 1.31329328247722981e62 or 5.26434816177796769e115 < y

    1. Initial program 33.0

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

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

      \[\leadsto \color{blue}{\log \left(e^{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 562.72914128011621 \lor \neg \left(y \le 1.31329328247722981 \cdot 10^{62}\right) \land y \le 5.26434816177796769 \cdot 10^{115}:\\ \;\;\;\;\frac{{1}^{\left(\sqrt[3]{x}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\ \end{array}\]

Reproduce

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