Average Error: 11.0 → 1.9
Time: 5.4s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -7.006483848542437442574737360700964927673 \lor \neg \left(x \le 2.852199015031174304536241058074557641432 \cdot 10^{-14}\right):\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{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 -7.006483848542437442574737360700964927673 \lor \neg \left(x \le 2.852199015031174304536241058074557641432 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r446914 = x;
        double r446915 = y;
        double r446916 = r446914 + r446915;
        double r446917 = r446914 / r446916;
        double r446918 = log(r446917);
        double r446919 = r446914 * r446918;
        double r446920 = exp(r446919);
        double r446921 = r446920 / r446914;
        return r446921;
}

double f(double x, double y) {
        double r446922 = x;
        double r446923 = -7.006483848542437;
        bool r446924 = r446922 <= r446923;
        double r446925 = 2.852199015031174e-14;
        bool r446926 = r446922 <= r446925;
        double r446927 = !r446926;
        bool r446928 = r446924 || r446927;
        double r446929 = -1.0;
        double r446930 = y;
        double r446931 = r446929 * r446930;
        double r446932 = exp(r446931);
        double r446933 = r446932 / r446922;
        double r446934 = 1.0;
        double r446935 = r446922 + r446930;
        double r446936 = cbrt(r446935);
        double r446937 = r446936 * r446936;
        double r446938 = r446934 / r446937;
        double r446939 = pow(r446938, r446922);
        double r446940 = r446922 / r446936;
        double r446941 = pow(r446940, r446922);
        double r446942 = r446939 * r446941;
        double r446943 = r446942 / r446922;
        double r446944 = r446928 ? r446933 : r446943;
        return r446944;
}

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.0
Target8.2
Herbie1.9
\[\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 < -7.006483848542437 or 2.852199015031174e-14 < x

    1. Initial program 10.3

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

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

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

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

    if -7.006483848542437 < x < 2.852199015031174e-14

    1. Initial program 11.8

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

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

      \[\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}}{x}\]
    5. Applied *-un-lft-identity11.8

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

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

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

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

Reproduce

herbie shell --seed 2019353 +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))