Average Error: 11.6 → 0.2
Time: 21.0s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -338166549708266081878016 \lor \neg \left(x \le 5.105764663642184685065153471050791722519 \cdot 10^{-5}\right):\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) \cdot 2\right) \cdot x}}{\frac{x}{{\left(\sqrt{\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}}\right)}^{x} \cdot {\left(\sqrt{\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}}\right)}^{x}}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -338166549708266081878016 \lor \neg \left(x \le 5.105764663642184685065153471050791722519 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r337194 = x;
        double r337195 = y;
        double r337196 = r337194 + r337195;
        double r337197 = r337194 / r337196;
        double r337198 = log(r337197);
        double r337199 = r337194 * r337198;
        double r337200 = exp(r337199);
        double r337201 = r337200 / r337194;
        return r337201;
}

double f(double x, double y) {
        double r337202 = x;
        double r337203 = -3.381665497082661e+23;
        bool r337204 = r337202 <= r337203;
        double r337205 = 5.105764663642185e-05;
        bool r337206 = r337202 <= r337205;
        double r337207 = !r337206;
        bool r337208 = r337204 || r337207;
        double r337209 = y;
        double r337210 = -r337209;
        double r337211 = exp(r337210);
        double r337212 = r337211 / r337202;
        double r337213 = cbrt(r337202);
        double r337214 = r337209 + r337202;
        double r337215 = cbrt(r337214);
        double r337216 = r337213 / r337215;
        double r337217 = log(r337216);
        double r337218 = 2.0;
        double r337219 = r337217 * r337218;
        double r337220 = r337219 * r337202;
        double r337221 = exp(r337220);
        double r337222 = sqrt(r337216);
        double r337223 = pow(r337222, r337202);
        double r337224 = r337223 * r337223;
        double r337225 = r337202 / r337224;
        double r337226 = r337221 / r337225;
        double r337227 = r337208 ? r337212 : r337226;
        return r337227;
}

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.6
Target8.2
Herbie0.2
\[\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 x < -3.381665497082661e+23 or 5.105764663642185e-05 < x

    1. Initial program 11.6

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified11.6

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\]
    3. Taylor expanded around inf 0.3

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

    if -3.381665497082661e+23 < x < 5.105764663642185e-05

    1. Initial program 11.6

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified11.6

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

      \[\leadsto \frac{{\left(\frac{x}{\color{blue}{\left(\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}\right) \cdot \sqrt[3]{y + x}}}\right)}^{x}}{x}\]
    5. Applied add-cube-cbrt11.6

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

      \[\leadsto \frac{{\color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}}^{x}}{x}\]
    7. Applied unpow-prod-down2.3

      \[\leadsto \frac{\color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}{x}\]
    8. Applied associate-/l*2.3

      \[\leadsto \color{blue}{\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}}\]
    9. Using strategy rm
    10. Applied add-exp-log34.2

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \color{blue}{e^{\log \left(\sqrt[3]{y + x}\right)}}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    11. Applied add-exp-log34.2

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\color{blue}{e^{\log \left(\sqrt[3]{y + x}\right)}} \cdot e^{\log \left(\sqrt[3]{y + x}\right)}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    12. Applied prod-exp34.2

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

      \[\leadsto \frac{{\left(\frac{\sqrt[3]{x} \cdot \color{blue}{e^{\log \left(\sqrt[3]{x}\right)}}}{e^{\log \left(\sqrt[3]{y + x}\right) + \log \left(\sqrt[3]{y + x}\right)}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    14. Applied add-exp-log34.2

      \[\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]{y + x}\right) + \log \left(\sqrt[3]{y + x}\right)}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    15. Applied prod-exp34.2

      \[\leadsto \frac{{\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)}}}{e^{\log \left(\sqrt[3]{y + x}\right) + \log \left(\sqrt[3]{y + x}\right)}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    16. Applied div-exp34.2

      \[\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]{y + x}\right) + \log \left(\sqrt[3]{y + x}\right)\right)}\right)}}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    17. Applied pow-exp33.1

      \[\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]{y + x}\right) + \log \left(\sqrt[3]{y + x}\right)\right)\right) \cdot x}}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    18. Simplified0.1

      \[\leadsto \frac{e^{\color{blue}{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right) \cdot x}}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\]
    19. Using strategy rm
    20. Applied add-sqr-sqrt0.1

      \[\leadsto \frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right) \cdot x}}{\frac{x}{{\color{blue}{\left(\sqrt{\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}} \cdot \sqrt{\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}}\right)}}^{x}}}\]
    21. Applied unpow-prod-down0.1

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

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

Reproduce

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

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