Average Error: 11.1 → 1.6
Time: 5.1s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -9.0406218052466463 \cdot 10^{-16} \lor \neg \left(x \le 4.808874715698341 \cdot 10^{-10}\right):\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{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 -9.0406218052466463 \cdot 10^{-16} \lor \neg \left(x \le 4.808874715698341 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r339878 = x;
        double r339879 = y;
        double r339880 = r339878 + r339879;
        double r339881 = r339878 / r339880;
        double r339882 = log(r339881);
        double r339883 = r339878 * r339882;
        double r339884 = exp(r339883);
        double r339885 = r339884 / r339878;
        return r339885;
}

double f(double x, double y) {
        double r339886 = x;
        double r339887 = -9.040621805246646e-16;
        bool r339888 = r339886 <= r339887;
        double r339889 = 4.808874715698341e-10;
        bool r339890 = r339886 <= r339889;
        double r339891 = !r339890;
        bool r339892 = r339888 || r339891;
        double r339893 = -1.0;
        double r339894 = y;
        double r339895 = r339893 * r339894;
        double r339896 = exp(r339895);
        double r339897 = r339896 / r339886;
        double r339898 = cbrt(r339886);
        double r339899 = r339898 * r339898;
        double r339900 = 1.0;
        double r339901 = r339899 / r339900;
        double r339902 = pow(r339901, r339886);
        double r339903 = r339886 + r339894;
        double r339904 = r339898 / r339903;
        double r339905 = pow(r339904, r339886);
        double r339906 = r339902 * r339905;
        double r339907 = r339906 / r339886;
        double r339908 = r339892 ? r339897 : r339907;
        return r339908;
}

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.1
Target8.1
Herbie1.6
\[\begin{array}{l} \mathbf{if}\;y \lt -3.73118442066479561 \cdot 10^{94}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \mathbf{elif}\;y \lt 2.81795924272828789 \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 < -9.040621805246646e-16 or 4.808874715698341e-10 < x

    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. Taylor expanded around inf 0.9

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

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

    if -9.040621805246646e-16 < x < 4.808874715698341e-10

    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}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity11.6

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

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

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

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

Reproduce

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