Average Error: 11.2 → 0.9
Time: 19.5s
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 r23357036 = x;
        double r23357037 = y;
        double r23357038 = r23357036 + r23357037;
        double r23357039 = r23357036 / r23357038;
        double r23357040 = log(r23357039);
        double r23357041 = r23357036 * r23357040;
        double r23357042 = exp(r23357041);
        double r23357043 = r23357042 / r23357036;
        return r23357043;
}

double f(double x, double y) {
        double r23357044 = x;
        double r23357045 = -8.159628703454281e+100;
        bool r23357046 = r23357044 <= r23357045;
        double r23357047 = y;
        double r23357048 = -r23357047;
        double r23357049 = exp(r23357048);
        double r23357050 = sqrt(r23357049);
        double r23357051 = cbrt(r23357044);
        double r23357052 = r23357051 * r23357051;
        double r23357053 = r23357050 / r23357052;
        double r23357054 = r23357050 / r23357051;
        double r23357055 = r23357053 * r23357054;
        double r23357056 = 7.89192717712585e+49;
        bool r23357057 = r23357044 <= r23357056;
        double r23357058 = exp(r23357052);
        double r23357059 = r23357047 + r23357044;
        double r23357060 = r23357044 / r23357059;
        double r23357061 = log(r23357060);
        double r23357062 = r23357061 * r23357051;
        double r23357063 = pow(r23357058, r23357062);
        double r23357064 = r23357063 / r23357044;
        double r23357065 = r23357057 ? r23357064 : r23357055;
        double r23357066 = r23357046 ? r23357055 : r23357065;
        return r23357066;
}

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))