Average Error: 11.4 → 0.3
Time: 8.9s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.878253153357071414016501670814455842941 \cdot 10^{90} \lor \neg \left(x \le 7.683820352854432996384339595030699143763 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot \left({\left(\frac{\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{x + y}}}\right)}^{x}\right)\right) \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -6.878253153357071414016501670814455842941 \cdot 10^{90} \lor \neg \left(x \le 7.683820352854432996384339595030699143763 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r458417 = x;
        double r458418 = y;
        double r458419 = r458417 + r458418;
        double r458420 = r458417 / r458419;
        double r458421 = log(r458420);
        double r458422 = r458417 * r458421;
        double r458423 = exp(r458422);
        double r458424 = r458423 / r458417;
        return r458424;
}

double f(double x, double y) {
        double r458425 = x;
        double r458426 = -6.878253153357071e+90;
        bool r458427 = r458425 <= r458426;
        double r458428 = 7.683820352854433e-07;
        bool r458429 = r458425 <= r458428;
        double r458430 = !r458429;
        bool r458431 = r458427 || r458430;
        double r458432 = -1.0;
        double r458433 = y;
        double r458434 = r458432 * r458433;
        double r458435 = exp(r458434);
        double r458436 = r458435 / r458425;
        double r458437 = cbrt(r458425);
        double r458438 = r458425 + r458433;
        double r458439 = cbrt(r458438);
        double r458440 = r458437 / r458439;
        double r458441 = pow(r458440, r458425);
        double r458442 = r458437 * r458437;
        double r458443 = cbrt(r458442);
        double r458444 = r458439 * r458439;
        double r458445 = cbrt(r458444);
        double r458446 = r458443 / r458445;
        double r458447 = pow(r458446, r458425);
        double r458448 = cbrt(r458437);
        double r458449 = cbrt(r458439);
        double r458450 = r458448 / r458449;
        double r458451 = pow(r458450, r458425);
        double r458452 = r458447 * r458451;
        double r458453 = r458441 * r458452;
        double r458454 = r458441 / r458425;
        double r458455 = r458453 * r458454;
        double r458456 = r458431 ? r458436 : r458455;
        return r458456;
}

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.4
Target8.0
Herbie0.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 x < -6.878253153357071e+90 or 7.683820352854433e-07 < x

    1. Initial program 12.3

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

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

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

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

    if -6.878253153357071e+90 < x < 7.683820352854433e-07

    1. Initial program 10.7

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity10.7

      \[\leadsto \frac{{\left(\frac{x}{x + y}\right)}^{x}}{\color{blue}{1 \cdot x}}\]
    5. Applied add-cube-cbrt15.7

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

      \[\leadsto \frac{{\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}}{1 \cdot x}\]
    7. Applied times-frac10.7

      \[\leadsto \frac{{\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}}{1 \cdot x}\]
    8. Applied unpow-prod-down2.5

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x}}{1} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}}\]
    10. Simplified2.5

      \[\leadsto \color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x}} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    11. Using strategy rm
    12. Applied times-frac2.5

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

      \[\leadsto \color{blue}{\left({\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}\right)} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    14. Using strategy rm
    15. Applied add-cube-cbrt2.5

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

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

      \[\leadsto \left({\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}}{\sqrt[3]{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}} \cdot \sqrt[3]{\sqrt[3]{x + y}}}\right)}^{x}\right) \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    18. Applied cbrt-prod0.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -6.878253153357071414016501670814455842941 \cdot 10^{90} \lor \neg \left(x \le 7.683820352854432996384339595030699143763 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot \left({\left(\frac{\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{x + y}}}\right)}^{x}\right)\right) \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \end{array}\]

Reproduce

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

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