Average Error: 11.2 → 0.9
Time: 19.7s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -8.159628703454281 \cdot 10^{+100}:\\ \;\;\;\;\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}\\ \mathbf{elif}\;x \le 7.89192717712585 \cdot 10^{+49}:\\ \;\;\;\;\frac{{\left(e^{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right)}^{\left(\log \left(\frac{x}{y + x}\right) \cdot \sqrt[3]{x}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -8.159628703454281 \cdot 10^{+100}:\\
\;\;\;\;\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}\\

\mathbf{elif}\;x \le 7.89192717712585 \cdot 10^{+49}:\\
\;\;\;\;\frac{{\left(e^{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right)}^{\left(\log \left(\frac{x}{y + x}\right) \cdot \sqrt[3]{x}\right)}}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}\\

\end{array}
double f(double x, double y) {
        double r22409172 = x;
        double r22409173 = y;
        double r22409174 = r22409172 + r22409173;
        double r22409175 = r22409172 / r22409174;
        double r22409176 = log(r22409175);
        double r22409177 = r22409172 * r22409176;
        double r22409178 = exp(r22409177);
        double r22409179 = r22409178 / r22409172;
        return r22409179;
}

double f(double x, double y) {
        double r22409180 = x;
        double r22409181 = -8.159628703454281e+100;
        bool r22409182 = r22409180 <= r22409181;
        double r22409183 = y;
        double r22409184 = -r22409183;
        double r22409185 = exp(r22409184);
        double r22409186 = sqrt(r22409185);
        double r22409187 = cbrt(r22409180);
        double r22409188 = r22409187 * r22409187;
        double r22409189 = r22409186 / r22409188;
        double r22409190 = r22409186 / r22409187;
        double r22409191 = r22409189 * r22409190;
        double r22409192 = 7.89192717712585e+49;
        bool r22409193 = r22409180 <= r22409192;
        double r22409194 = exp(r22409188);
        double r22409195 = r22409183 + r22409180;
        double r22409196 = r22409180 / r22409195;
        double r22409197 = log(r22409196);
        double r22409198 = r22409197 * r22409187;
        double r22409199 = pow(r22409194, r22409198);
        double r22409200 = r22409199 / r22409180;
        double r22409201 = r22409193 ? r22409200 : r22409191;
        double r22409202 = r22409182 ? r22409191 : r22409201;
        return r22409202;
}

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
Target7.9
Herbie0.9
\[\begin{array}{l} \mathbf{if}\;y \lt -3.7311844206647956 \cdot 10^{+94}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \mathbf{elif}\;y \lt 2.817959242728288 \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 x < -8.159628703454281e+100 or 7.89192717712585e+49 < x

    1. Initial program 13.4

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \frac{\color{blue}{e^{-1 \cdot y}}}{x}\]
    3. Simplified0.0

      \[\leadsto \frac{\color{blue}{e^{-y}}}{x}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.9

      \[\leadsto \frac{e^{-y}}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}\]
    6. Applied add-sqr-sqrt0.9

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

      \[\leadsto \color{blue}{\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}}\]

    if -8.159628703454281e+100 < x < 7.89192717712585e+49

    1. Initial program 9.6

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

      \[\leadsto \frac{e^{\color{blue}{\log \left(e^{x}\right)} \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    4. Applied exp-to-pow1.0

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\log \left(\frac{x}{x + y}\right)\right)}}}{x}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt1.0

      \[\leadsto \frac{{\left(e^{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}\right)}^{\left(\log \left(\frac{x}{x + y}\right)\right)}}{x}\]
    7. Applied exp-prod1.0

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right)}^{\left(\sqrt[3]{x}\right)}\right)}}^{\left(\log \left(\frac{x}{x + y}\right)\right)}}{x}\]
    8. Applied pow-pow0.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -8.159628703454281 \cdot 10^{+100}:\\ \;\;\;\;\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}\\ \mathbf{elif}\;x \le 7.89192717712585 \cdot 10^{+49}:\\ \;\;\;\;\frac{{\left(e^{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right)}^{\left(\log \left(\frac{x}{y + x}\right) \cdot \sqrt[3]{x}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{e^{-y}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{e^{-y}}}{\sqrt[3]{x}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y -3.7311844206647956e+94) (/ (exp (/ -1 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 y)) x))))

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