Average Error: 11.2 → 5.3
Time: 16.2s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \le 63650307679534716100354087104615030980610 \lor \neg \left(y \le 1.320595172649293990309836056567813281437 \cdot 10^{157}\right):\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \log \left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}} \cdot \frac{x}{\sqrt[3]{x + y}}\right)}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \le 63650307679534716100354087104615030980610 \lor \neg \left(y \le 1.320595172649293990309836056567813281437 \cdot 10^{157}\right):\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r265137 = x;
        double r265138 = y;
        double r265139 = r265137 + r265138;
        double r265140 = r265137 / r265139;
        double r265141 = log(r265140);
        double r265142 = r265137 * r265141;
        double r265143 = exp(r265142);
        double r265144 = r265143 / r265137;
        return r265144;
}

double f(double x, double y) {
        double r265145 = y;
        double r265146 = 6.365030767953472e+40;
        bool r265147 = r265145 <= r265146;
        double r265148 = 1.320595172649294e+157;
        bool r265149 = r265145 <= r265148;
        double r265150 = !r265149;
        bool r265151 = r265147 || r265150;
        double r265152 = x;
        double r265153 = 2.0;
        double r265154 = cbrt(r265152);
        double r265155 = r265152 + r265145;
        double r265156 = cbrt(r265155);
        double r265157 = r265154 / r265156;
        double r265158 = log(r265157);
        double r265159 = r265153 * r265158;
        double r265160 = r265152 * r265159;
        double r265161 = r265152 * r265158;
        double r265162 = r265160 + r265161;
        double r265163 = exp(r265162);
        double r265164 = r265163 / r265152;
        double r265165 = 1.0;
        double r265166 = r265156 * r265156;
        double r265167 = r265165 / r265166;
        double r265168 = r265152 / r265156;
        double r265169 = r265167 * r265168;
        double r265170 = log(r265169);
        double r265171 = r265152 * r265170;
        double r265172 = exp(r265171);
        double r265173 = r265172 / r265152;
        double r265174 = r265151 ? r265164 : r265173;
        return r265174;
}

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.2
Target8.1
Herbie5.3
\[\begin{array}{l} \mathbf{if}\;y \lt -3.73118442066479561492798134439269393419 \cdot 10^{94}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \mathbf{elif}\;y \lt 28179592427282878868860376020282245120:\\ \;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\ \mathbf{elif}\;y \lt 2.347387415166997963747840232163110922613 \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 < 6.365030767953472e+40 or 1.320595172649294e+157 < y

    1. Initial program 8.7

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt28.1

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{\color{blue}{\left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right) \cdot \sqrt[3]{x + y}}}\right)}}{x}\]
    4. Applied add-cube-cbrt8.7

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    5. Applied times-frac8.7

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    6. Applied log-prod4.5

      \[\leadsto \frac{e^{x \cdot \color{blue}{\left(\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}}{x}\]
    7. Applied distribute-lft-in4.5

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

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

    if 6.365030767953472e+40 < y < 1.320595172649294e+157

    1. Initial program 34.3

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt22.5

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{\color{blue}{\left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right) \cdot \sqrt[3]{x + y}}}\right)}}{x}\]
    4. Applied *-un-lft-identity22.5

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    5. Applied times-frac22.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 63650307679534716100354087104615030980610 \lor \neg \left(y \le 1.320595172649293990309836056567813281437 \cdot 10^{157}\right):\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \log \left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}} \cdot \frac{x}{\sqrt[3]{x + y}}\right)}}{x}\\ \end{array}\]

Reproduce

herbie shell --seed 2019298 
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
  :precision binary64

  :herbie-target
  (if (< y -3.73118442066479561e94) (/ (exp (/ -1 y)) x) (if (< y 2.81795924272828789e37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))

  (/ (exp (* x (log (/ x (+ x y))))) x))