Average Error: 11.3 → 1.8
Time: 4.1s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -5.595667354331363974040414177579805254936 \lor \neg \left(x \le 1.285210522973264513379749052895961725085 \cdot 10^{-8}\right):\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \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 -5.595667354331363974040414177579805254936 \lor \neg \left(x \le 1.285210522973264513379749052895961725085 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\

\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 r542859 = x;
        double r542860 = y;
        double r542861 = r542859 + r542860;
        double r542862 = r542859 / r542861;
        double r542863 = log(r542862);
        double r542864 = r542859 * r542863;
        double r542865 = exp(r542864);
        double r542866 = r542865 / r542859;
        return r542866;
}

double f(double x, double y) {
        double r542867 = x;
        double r542868 = -5.595667354331364;
        bool r542869 = r542867 <= r542868;
        double r542870 = 1.2852105229732645e-08;
        bool r542871 = r542867 <= r542870;
        double r542872 = !r542871;
        bool r542873 = r542869 || r542872;
        double r542874 = 1.0;
        double r542875 = y;
        double r542876 = exp(r542875);
        double r542877 = r542867 * r542876;
        double r542878 = r542874 / r542877;
        double r542879 = cbrt(r542867);
        double r542880 = r542879 * r542879;
        double r542881 = r542880 / r542874;
        double r542882 = pow(r542881, r542867);
        double r542883 = r542867 + r542875;
        double r542884 = r542879 / r542883;
        double r542885 = pow(r542884, r542867);
        double r542886 = r542882 * r542885;
        double r542887 = r542886 / r542867;
        double r542888 = r542873 ? r542878 : r542887;
        return r542888;
}

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
Target8.0
Herbie1.8
\[\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 < -5.595667354331364 or 1.2852105229732645e-08 < x

    1. Initial program 11.0

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

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

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

      \[\leadsto \frac{\color{blue}{e^{-1 \cdot y}}}{x}\]
    5. Using strategy rm
    6. Applied clear-num0.4

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

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

    if -5.595667354331364 < x < 1.2852105229732645e-08

    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-down3.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -5.595667354331363974040414177579805254936 \lor \neg \left(x \le 1.285210522973264513379749052895961725085 \cdot 10^{-8}\right):\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \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 2019362 
(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))