Average Error: 10.8 → 0.2
Time: 24.8s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.122144077215159 \cdot 10^{+68}:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{elif}\;x \le 12.791495951037414:\\ \;\;\;\;\frac{\frac{1}{x}}{e^{x \cdot \left(\log \left(\frac{\sqrt[3]{y + x}}{\sqrt[3]{x}}\right) + \log \left(\frac{\sqrt[3]{y + x}}{\sqrt[3]{x}}\right)\right)}} \cdot e^{\log \left(\frac{\sqrt[3]{y + x}}{\sqrt[3]{x}}\right) \cdot \left(-x\right)}\\ \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 -2.122144077215159 \cdot 10^{+68}:\\
\;\;\;\;\frac{e^{-y}}{x}\\

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

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

\end{array}
double f(double x, double y) {
        double r7285591 = x;
        double r7285592 = y;
        double r7285593 = r7285591 + r7285592;
        double r7285594 = r7285591 / r7285593;
        double r7285595 = log(r7285594);
        double r7285596 = r7285591 * r7285595;
        double r7285597 = exp(r7285596);
        double r7285598 = r7285597 / r7285591;
        return r7285598;
}

double f(double x, double y) {
        double r7285599 = x;
        double r7285600 = -2.122144077215159e+68;
        bool r7285601 = r7285599 <= r7285600;
        double r7285602 = y;
        double r7285603 = -r7285602;
        double r7285604 = exp(r7285603);
        double r7285605 = r7285604 / r7285599;
        double r7285606 = 12.791495951037414;
        bool r7285607 = r7285599 <= r7285606;
        double r7285608 = 1.0;
        double r7285609 = r7285608 / r7285599;
        double r7285610 = r7285602 + r7285599;
        double r7285611 = cbrt(r7285610);
        double r7285612 = cbrt(r7285599);
        double r7285613 = r7285611 / r7285612;
        double r7285614 = log(r7285613);
        double r7285615 = r7285614 + r7285614;
        double r7285616 = r7285599 * r7285615;
        double r7285617 = exp(r7285616);
        double r7285618 = r7285609 / r7285617;
        double r7285619 = -r7285599;
        double r7285620 = r7285614 * r7285619;
        double r7285621 = exp(r7285620);
        double r7285622 = r7285618 * r7285621;
        double r7285623 = r7285607 ? r7285622 : r7285605;
        double r7285624 = r7285601 ? r7285605 : r7285623;
        return r7285624;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.8
Target7.7
Herbie0.2
\[\begin{array}{l} \mathbf{if}\;y \lt -3.7311844206647956 \cdot 10^{+94}:\\ \;\;\;\;\frac{e^{\frac{-1}{y}}}{x}\\ \mathbf{elif}\;y \lt 2.817959242728288 \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 2 regimes
  2. if x < -2.122144077215159e+68 or 12.791495951037414 < x

    1. Initial program 11.3

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

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

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

    if -2.122144077215159e+68 < x < 12.791495951037414

    1. Initial program 10.4

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied clear-num11.4

      \[\leadsto \frac{e^{x \cdot \log \color{blue}{\left(\frac{1}{\frac{x + y}{x}}\right)}}}{x}\]
    4. Applied log-rec11.4

      \[\leadsto \frac{e^{x \cdot \color{blue}{\left(-\log \left(\frac{x + y}{x}\right)\right)}}}{x}\]
    5. Applied distribute-rgt-neg-out11.4

      \[\leadsto \frac{e^{\color{blue}{-x \cdot \log \left(\frac{x + y}{x}\right)}}}{x}\]
    6. Applied exp-neg11.5

      \[\leadsto \frac{\color{blue}{\frac{1}{e^{x \cdot \log \left(\frac{x + y}{x}\right)}}}}{x}\]
    7. Applied associate-/l/11.4

      \[\leadsto \color{blue}{\frac{1}{x \cdot e^{x \cdot \log \left(\frac{x + y}{x}\right)}}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt15.1

      \[\leadsto \frac{1}{x \cdot e^{x \cdot \log \left(\frac{x + y}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}\right)}}\]
    10. Applied add-cube-cbrt11.5

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

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

      \[\leadsto \frac{1}{x \cdot e^{x \cdot \color{blue}{\left(\log \left(\frac{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \log \left(\frac{\sqrt[3]{x + y}}{\sqrt[3]{x}}\right)\right)}}}\]
    13. Applied distribute-lft-in3.5

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

      \[\leadsto \frac{1}{x \cdot \color{blue}{\left(e^{x \cdot \log \left(\frac{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right)} \cdot e^{x \cdot \log \left(\frac{\sqrt[3]{x + y}}{\sqrt[3]{x}}\right)}\right)}}\]
    15. Applied associate-*r*3.5

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019158 
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"

  :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))