Average Error: 11.2 → 0.3
Time: 23.6s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -274.47601542862543:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{elif}\;x \le 9.888607073668458 \cdot 10^{-12}:\\ \;\;\;\;\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{e^{-y}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -274.47601542862543:\\
\;\;\;\;\frac{e^{-y}}{x}\\

\mathbf{elif}\;x \le 9.888607073668458 \cdot 10^{-12}:\\
\;\;\;\;\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{e^{-y}}{x}\\

\end{array}
double f(double x, double y) {
        double r20150803 = x;
        double r20150804 = y;
        double r20150805 = r20150803 + r20150804;
        double r20150806 = r20150803 / r20150805;
        double r20150807 = log(r20150806);
        double r20150808 = r20150803 * r20150807;
        double r20150809 = exp(r20150808);
        double r20150810 = r20150809 / r20150803;
        return r20150810;
}

double f(double x, double y) {
        double r20150811 = x;
        double r20150812 = -274.47601542862543;
        bool r20150813 = r20150811 <= r20150812;
        double r20150814 = y;
        double r20150815 = -r20150814;
        double r20150816 = exp(r20150815);
        double r20150817 = r20150816 / r20150811;
        double r20150818 = 9.888607073668458e-12;
        bool r20150819 = r20150811 <= r20150818;
        double r20150820 = cbrt(r20150811);
        double r20150821 = r20150820 * r20150820;
        double r20150822 = exp(r20150821);
        double r20150823 = r20150814 + r20150811;
        double r20150824 = r20150811 / r20150823;
        double r20150825 = log(r20150824);
        double r20150826 = r20150825 * r20150820;
        double r20150827 = pow(r20150822, r20150826);
        double r20150828 = r20150827 / r20150811;
        double r20150829 = r20150819 ? r20150828 : r20150817;
        double r20150830 = r20150813 ? r20150817 : r20150829;
        return r20150830;
}

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.3
\[\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 < -274.47601542862543 or 9.888607073668458e-12 < x

    1. Initial program 11.1

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

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

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

    if -274.47601542862543 < x < 9.888607073668458e-12

    1. Initial program 11.2

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

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

      \[\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-cbrt0.1

      \[\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-prod0.1

      \[\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.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -274.47601542862543:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{elif}\;x \le 9.888607073668458 \cdot 10^{-12}:\\ \;\;\;\;\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{e^{-y}}{x}\\ \end{array}\]

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(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))