Average Error: 10.7 → 4.7
Time: 5.6s
Precision: binary64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \leq 124.59949045110731:\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 2.5779544643503928 \cdot 10^{+94}:\\ \;\;\;\;\frac{{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 1.0720527371918883 \cdot 10^{+168}:\\ \;\;\;\;\frac{{\left(\frac{1}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}} \cdot \frac{x}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{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 124.59949045110731:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\

\mathbf{elif}\;y \leq 2.5779544643503928 \cdot 10^{+94}:\\
\;\;\;\;\frac{{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\

\mathbf{elif}\;y \leq 1.0720527371918883 \cdot 10^{+168}:\\
\;\;\;\;\frac{{\left(\frac{1}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}} \cdot \frac{x}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\

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

\end{array}
(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
(FPCore (x y)
 :precision binary64
 (if (<= y 124.59949045110731)
   (/
    (*
     (exp (* x (* 2.0 (log (/ (cbrt x) (cbrt (+ y x)))))))
     (pow (/ (cbrt x) (cbrt (+ y x))) x))
    x)
   (if (<= y 2.5779544643503928e+94)
     (/ (pow (* (* (cbrt x) (cbrt x)) (/ (cbrt x) (+ y x))) x) x)
     (if (<= y 1.0720527371918883e+168)
       (/
        (pow
         (* (/ 1.0 (* (cbrt (+ y x)) (cbrt (+ y x)))) (/ x (cbrt (+ y x))))
         x)
        x)
       (/
        (*
         (exp (* x (* 2.0 (log (/ (cbrt x) (cbrt (+ y x)))))))
         (pow (/ (cbrt x) (cbrt (+ y x))) x))
        x)))))
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 <= 124.59949045110731)) {
		tmp = (((double) (((double) exp(((double) (x * ((double) (2.0 * ((double) log((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))))))))))) * ((double) pow((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))), x)))) / x);
	} else {
		double tmp_1;
		if ((y <= 2.5779544643503928e+94)) {
			tmp_1 = (((double) pow(((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * (((double) cbrt(x)) / ((double) (y + x))))), x)) / x);
		} else {
			double tmp_2;
			if ((y <= 1.0720527371918883e+168)) {
				tmp_2 = (((double) pow(((double) ((1.0 / ((double) (((double) cbrt(((double) (y + x)))) * ((double) cbrt(((double) (y + x))))))) * (x / ((double) cbrt(((double) (y + x))))))), x)) / x);
			} else {
				tmp_2 = (((double) (((double) exp(((double) (x * ((double) (2.0 * ((double) log((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))))))))))) * ((double) pow((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))), x)))) / x);
			}
			tmp_1 = tmp_2;
		}
		tmp = tmp_1;
	}
	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

Original10.7
Target7.6
Herbie4.7
\[\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 3 regimes
  2. if y < 124.599490451107314 or 1.0720527371918883e168 < y

    1. Initial program Error: 6.8 bits

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

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

      \[\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-cbrtError: 6.8 bits

      \[\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-fracError: 6.8 bits

      \[\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-downError: 2.8 bits

      \[\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. Using strategy rm
    9. Applied add-exp-logError: 47.1 bits

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \color{blue}{e^{\log \left(\sqrt[3]{x + y}\right)}}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    10. Applied add-exp-logError: 47.1 bits

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\color{blue}{e^{\log \left(\sqrt[3]{x + y}\right)}} \cdot e^{\log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    11. Applied prod-expError: 47.3 bits

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\color{blue}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    12. Applied add-exp-logError: 47.2 bits

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \color{blue}{e^{\log \left(\sqrt[3]{x}\right)}}}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    13. Applied add-exp-logError: 41.0 bits

      \[\leadsto \frac{{\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{x}\right)}} \cdot e^{\log \left(\sqrt[3]{x}\right)}}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    14. Applied prod-expError: 34.1 bits

      \[\leadsto \frac{{\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)}}}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    15. Applied div-expError: 34.1 bits

      \[\leadsto \frac{{\color{blue}{\left(e^{\left(\log \left(\sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)\right) - \left(\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)\right)}\right)}}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    16. Applied pow-expError: 33.5 bits

      \[\leadsto \frac{\color{blue}{e^{\left(\left(\log \left(\sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)\right) - \left(\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)\right)\right) \cdot x}} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    17. SimplifiedError: 1.7 bits

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

    if 124.599490451107314 < y < 2.5779544643503928e94

    1. Initial program Error: 37.4 bits

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

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

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

      \[\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-fracError: 23.4 bits

      \[\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. SimplifiedError: 23.4 bits

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

    if 2.5779544643503928e94 < y < 1.0720527371918883e168

    1. Initial program Error: 32.2 bits

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

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

      \[\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 *-un-lft-identityError: 23.2 bits

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 124.59949045110731:\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 2.5779544643503928 \cdot 10^{+94}:\\ \;\;\;\;\frac{{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \leq 1.0720527371918883 \cdot 10^{+168}:\\ \;\;\;\;\frac{{\left(\frac{1}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}} \cdot \frac{x}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{x}\\ \end{array}\]

Reproduce

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