Average Error: 11.3 → 0.1
Time: 9.6s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1247479169365479405675639472128 \lor \neg \left(x \le 17.83210846248629621868531103245913982391\right):\\ \;\;\;\;\sqrt{e^{-1 \cdot y}} \cdot \frac{\sqrt{e^{-1 \cdot y}}}{x}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\right)} \cdot {\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\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 -1247479169365479405675639472128 \lor \neg \left(x \le 17.83210846248629621868531103245913982391\right):\\
\;\;\;\;\sqrt{e^{-1 \cdot y}} \cdot \frac{\sqrt{e^{-1 \cdot y}}}{x}\\

\mathbf{else}:\\
\;\;\;\;\left({\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\right)} \cdot {\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\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 r268704 = x;
        double r268705 = y;
        double r268706 = r268704 + r268705;
        double r268707 = r268704 / r268706;
        double r268708 = log(r268707);
        double r268709 = r268704 * r268708;
        double r268710 = exp(r268709);
        double r268711 = r268710 / r268704;
        return r268711;
}

double f(double x, double y) {
        double r268712 = x;
        double r268713 = -1.2474791693654794e+30;
        bool r268714 = r268712 <= r268713;
        double r268715 = 17.832108462486296;
        bool r268716 = r268712 <= r268715;
        double r268717 = !r268716;
        bool r268718 = r268714 || r268717;
        double r268719 = -1.0;
        double r268720 = y;
        double r268721 = r268719 * r268720;
        double r268722 = exp(r268721);
        double r268723 = sqrt(r268722);
        double r268724 = r268723 / r268712;
        double r268725 = r268723 * r268724;
        double r268726 = cbrt(r268712);
        double r268727 = r268712 + r268720;
        double r268728 = cbrt(r268727);
        double r268729 = r268726 / r268728;
        double r268730 = fabs(r268729);
        double r268731 = 2.0;
        double r268732 = r268712 / r268731;
        double r268733 = r268731 * r268732;
        double r268734 = pow(r268730, r268733);
        double r268735 = r268734 * r268734;
        double r268736 = pow(r268729, r268712);
        double r268737 = r268736 / r268712;
        double r268738 = r268735 * r268737;
        double r268739 = r268718 ? r268725 : r268738;
        return r268739;
}

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.3
Target7.8
Herbie0.1
\[\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 < -1.2474791693654794e+30 or 17.832108462486296 < x

    1. Initial program 11.1

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

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

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

      \[\leadsto \frac{\color{blue}{e^{-1 \cdot y}}}{x}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity0.0

      \[\leadsto \frac{e^{-1 \cdot y}}{\color{blue}{1 \cdot x}}\]
    7. Applied add-sqr-sqrt0.1

      \[\leadsto \frac{\color{blue}{\sqrt{e^{-1 \cdot y}} \cdot \sqrt{e^{-1 \cdot y}}}}{1 \cdot x}\]
    8. Applied times-frac0.1

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

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

    if -1.2474791693654794e+30 < x < 17.832108462486296

    1. Initial program 11.4

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

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

      \[\leadsto \frac{{\left(\frac{x}{x + y}\right)}^{x}}{\color{blue}{1 \cdot x}}\]
    5. Applied add-cube-cbrt12.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-cbrt11.4

      \[\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-frac11.4

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

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

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

      \[\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 add-sqr-sqrt2.6

      \[\leadsto {\color{blue}{\left(\sqrt{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}} \cdot \sqrt{\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}\]
    13. Applied unpow-prod-down2.6

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

      \[\leadsto \left(\color{blue}{{\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\right)}} \cdot {\left(\sqrt{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}}\right)}^{x}\right) \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    15. Simplified0.1

      \[\leadsto \left({\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\right)} \cdot \color{blue}{{\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\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.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1247479169365479405675639472128 \lor \neg \left(x \le 17.83210846248629621868531103245913982391\right):\\ \;\;\;\;\sqrt{e^{-1 \cdot y}} \cdot \frac{\sqrt{e^{-1 \cdot y}}}{x}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\right)} \cdot {\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{\left(2 \cdot \frac{x}{2}\right)}\right) \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y -3.73118442066479561e94) (/ (exp (/ -1 y)) x) (if (< y 2.81795924272828789e37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))

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