Average Error: 11.3 → 1.0
Time: 7.5s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -34762.528692470238:\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{elif}\;x \le 25.356729299496507:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\\ \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 -34762.528692470238:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\

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

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

\end{array}
double f(double x, double y) {
        double r401621 = x;
        double r401622 = y;
        double r401623 = r401621 + r401622;
        double r401624 = r401621 / r401623;
        double r401625 = log(r401624);
        double r401626 = r401621 * r401625;
        double r401627 = exp(r401626);
        double r401628 = r401627 / r401621;
        return r401628;
}

double f(double x, double y) {
        double r401629 = x;
        double r401630 = -34762.52869247024;
        bool r401631 = r401629 <= r401630;
        double r401632 = 1.0;
        double r401633 = y;
        double r401634 = exp(r401633);
        double r401635 = r401629 * r401634;
        double r401636 = r401632 / r401635;
        double r401637 = 25.356729299496507;
        bool r401638 = r401629 <= r401637;
        double r401639 = cbrt(r401629);
        double r401640 = r401639 * r401639;
        double r401641 = r401629 + r401633;
        double r401642 = cbrt(r401641);
        double r401643 = r401642 * r401642;
        double r401644 = r401640 / r401643;
        double r401645 = pow(r401644, r401629);
        double r401646 = r401639 / r401642;
        double r401647 = pow(r401646, r401629);
        double r401648 = r401629 / r401647;
        double r401649 = r401645 / r401648;
        double r401650 = -1.0;
        double r401651 = r401650 * r401633;
        double r401652 = exp(r401651);
        double r401653 = r401652 / r401629;
        double r401654 = r401638 ? r401649 : r401653;
        double r401655 = r401631 ? r401636 : r401654;
        return r401655;
}

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

    1. Initial program 12.2

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

      \[\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}\]
    4. Simplified0.1

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

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

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

    if -34762.52869247024 < x < 25.356729299496507

    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 add-cube-cbrt11.5

      \[\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 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}}{x}\]
    6. 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}}{x}\]
    7. Applied unpow-prod-down2.0

      \[\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}}}{x}\]
    8. Applied associate-/l*2.0

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

    if 25.356729299496507 < x

    1. Initial program 10.4

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Simplified10.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}\]
    4. Simplified0.1

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

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

Reproduce

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