Average Error: 11.1 → 0.2
Time: 6.6s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.10353378791938817 \cdot 10^{36}:\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{elif}\;x \le 4.808874715698341 \cdot 10^{-10}:\\ \;\;\;\;\frac{e^{\sqrt[3]{{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}^{3}} \cdot x}}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -1.10353378791938817 \cdot 10^{36}:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\

\mathbf{elif}\;x \le 4.808874715698341 \cdot 10^{-10}:\\
\;\;\;\;\frac{e^{\sqrt[3]{{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}^{3}} \cdot x}}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\

\end{array}
double f(double x, double y) {
        double r435582 = x;
        double r435583 = y;
        double r435584 = r435582 + r435583;
        double r435585 = r435582 / r435584;
        double r435586 = log(r435585);
        double r435587 = r435582 * r435586;
        double r435588 = exp(r435587);
        double r435589 = r435588 / r435582;
        return r435589;
}

double f(double x, double y) {
        double r435590 = x;
        double r435591 = -1.1035337879193882e+36;
        bool r435592 = r435590 <= r435591;
        double r435593 = 1.0;
        double r435594 = y;
        double r435595 = exp(r435594);
        double r435596 = r435590 * r435595;
        double r435597 = r435593 / r435596;
        double r435598 = 4.808874715698341e-10;
        bool r435599 = r435590 <= r435598;
        double r435600 = 2.0;
        double r435601 = cbrt(r435590);
        double r435602 = r435590 + r435594;
        double r435603 = cbrt(r435602);
        double r435604 = r435601 / r435603;
        double r435605 = log(r435604);
        double r435606 = r435600 * r435605;
        double r435607 = 3.0;
        double r435608 = pow(r435606, r435607);
        double r435609 = cbrt(r435608);
        double r435610 = r435609 * r435590;
        double r435611 = exp(r435610);
        double r435612 = pow(r435604, r435590);
        double r435613 = r435612 / r435593;
        double r435614 = r435590 / r435613;
        double r435615 = r435611 / r435614;
        double r435616 = -1.0;
        double r435617 = r435616 * r435594;
        double r435618 = exp(r435617);
        double r435619 = r435618 / r435590;
        double r435620 = r435599 ? r435615 : r435619;
        double r435621 = r435592 ? r435597 : r435620;
        return r435621;
}

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
Herbie0.2
\[\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 3 regimes
  2. if x < -1.1035337879193882e+36

    1. Initial program 14.4

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Taylor expanded around inf 0.1

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

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

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

    if -1.1035337879193882e+36 < x < 4.808874715698341e-10

    1. Initial program 10.8

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt12.6

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{\color{blue}{\left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right) \cdot \sqrt[3]{x + y}}}\right)}}{x}\]
    4. Applied add-cube-cbrt10.8

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    5. Applied times-frac10.8

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    6. Applied log-prod1.9

      \[\leadsto \frac{e^{x \cdot \color{blue}{\left(\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}}{x}\]
    7. Applied distribute-rgt-in1.9

      \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) \cdot x + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) \cdot x}}}{x}\]
    8. Applied exp-sum1.9

      \[\leadsto \frac{\color{blue}{e^{\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) \cdot x} \cdot e^{\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) \cdot x}}}{x}\]
    9. Applied associate-/l*1.9

      \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) \cdot x}}{\frac{x}{e^{\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) \cdot x}}}}\]
    10. Simplified1.9

      \[\leadsto \frac{e^{\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) \cdot x}}{\color{blue}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}}\]
    11. Using strategy rm
    12. Applied add-cbrt-cube1.9

      \[\leadsto \frac{e^{\color{blue}{\sqrt[3]{\left(\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) \cdot \log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)\right) \cdot \log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}} \cdot x}}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}\]
    13. Simplified0.1

      \[\leadsto \frac{e^{\sqrt[3]{\color{blue}{{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}^{3}}} \cdot x}}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}\]

    if 4.808874715698341e-10 < x

    1. Initial program 9.2

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Taylor expanded around inf 0.5

      \[\leadsto \color{blue}{\frac{e^{-1 \cdot y}}{x}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.10353378791938817 \cdot 10^{36}:\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{elif}\;x \le 4.808874715698341 \cdot 10^{-10}:\\ \;\;\;\;\frac{e^{\sqrt[3]{{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}^{3}} \cdot x}}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \end{array}\]

Reproduce

herbie shell --seed 2020039 
(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))