Average Error: 11.3 → 0.1
Time: 20.0s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -828189259607921993226743361594940456960:\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{elif}\;x \le 2.66965085530503376531896719825454056263:\\ \;\;\;\;e^{\left(2 \cdot x\right) \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -828189259607921993226743361594940456960:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\

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

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

\end{array}
double f(double x, double y) {
        double r260761 = x;
        double r260762 = y;
        double r260763 = r260761 + r260762;
        double r260764 = r260761 / r260763;
        double r260765 = log(r260764);
        double r260766 = r260761 * r260765;
        double r260767 = exp(r260766);
        double r260768 = r260767 / r260761;
        return r260768;
}

double f(double x, double y) {
        double r260769 = x;
        double r260770 = -8.28189259607922e+38;
        bool r260771 = r260769 <= r260770;
        double r260772 = 1.0;
        double r260773 = y;
        double r260774 = exp(r260773);
        double r260775 = r260769 * r260774;
        double r260776 = r260772 / r260775;
        double r260777 = 2.6696508553050338;
        bool r260778 = r260769 <= r260777;
        double r260779 = 2.0;
        double r260780 = r260779 * r260769;
        double r260781 = cbrt(r260769);
        double r260782 = r260769 + r260773;
        double r260783 = cbrt(r260782);
        double r260784 = r260781 / r260783;
        double r260785 = log(r260784);
        double r260786 = r260780 * r260785;
        double r260787 = exp(r260786);
        double r260788 = pow(r260784, r260769);
        double r260789 = r260788 / r260769;
        double r260790 = r260787 * r260789;
        double r260791 = -r260773;
        double r260792 = exp(r260791);
        double r260793 = r260792 / r260769;
        double r260794 = r260778 ? r260790 : r260793;
        double r260795 = r260771 ? r260776 : r260794;
        return r260795;
}

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.1
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 3 regimes
  2. if x < -8.28189259607922e+38

    1. Initial program 13.7

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

      \[\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. Using strategy rm
    5. Applied clear-num0.0

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

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

    if -8.28189259607922e+38 < x < 2.6696508553050338

    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-cbrt13.2

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

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

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

      \[\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-exp-log34.5

      \[\leadsto {\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \color{blue}{e^{\log \left(\sqrt[3]{x + y}\right)}}}\right)}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    13. Applied add-exp-log34.5

      \[\leadsto {\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\color{blue}{e^{\log \left(\sqrt[3]{x + y}\right)}} \cdot e^{\log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    14. Applied prod-exp34.5

      \[\leadsto {\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\color{blue}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}}\right)}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    15. Applied add-exp-log34.5

      \[\leadsto {\left(\frac{\sqrt[3]{x} \cdot \color{blue}{e^{\log \left(\sqrt[3]{x}\right)}}}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    16. Applied add-exp-log34.5

      \[\leadsto {\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{x}\right)}} \cdot e^{\log \left(\sqrt[3]{x}\right)}}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    17. Applied prod-exp34.5

      \[\leadsto {\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)}}}{e^{\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)}}\right)}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    18. Applied div-exp34.5

      \[\leadsto {\color{blue}{\left(e^{\left(\log \left(\sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)\right) - \left(\log \left(\sqrt[3]{x + y}\right) + \log \left(\sqrt[3]{x + y}\right)\right)}\right)}}^{x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    19. Applied pow-exp33.4

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

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

    if 2.6696508553050338 < x

    1. Initial program 9.4

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

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

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

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

Reproduce

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