Average Error: 10.9 → 0.4
Time: 17.9s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -5.12799110664252433 \cdot 10^{64}:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{elif}\;x \le 3.5038509428931215 \cdot 10^{-13}:\\ \;\;\;\;\frac{e^{\left(\log \left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right) + \log \left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)\right) \cdot x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -5.12799110664252433 \cdot 10^{64}:\\
\;\;\;\;\frac{e^{-y}}{x}\\

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

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

\end{array}
double f(double x, double y) {
        double r1147732 = x;
        double r1147733 = y;
        double r1147734 = r1147732 + r1147733;
        double r1147735 = r1147732 / r1147734;
        double r1147736 = log(r1147735);
        double r1147737 = r1147732 * r1147736;
        double r1147738 = exp(r1147737);
        double r1147739 = r1147738 / r1147732;
        return r1147739;
}

double f(double x, double y) {
        double r1147740 = x;
        double r1147741 = -5.1279911066425243e+64;
        bool r1147742 = r1147740 <= r1147741;
        double r1147743 = y;
        double r1147744 = -r1147743;
        double r1147745 = exp(r1147744);
        double r1147746 = r1147745 / r1147740;
        double r1147747 = 3.5038509428931215e-13;
        bool r1147748 = r1147740 <= r1147747;
        double r1147749 = cbrt(r1147740);
        double r1147750 = r1147740 + r1147743;
        double r1147751 = cbrt(r1147750);
        double r1147752 = r1147749 / r1147751;
        double r1147753 = fabs(r1147752);
        double r1147754 = log(r1147753);
        double r1147755 = r1147754 + r1147754;
        double r1147756 = r1147755 * r1147740;
        double r1147757 = exp(r1147756);
        double r1147758 = pow(r1147752, r1147740);
        double r1147759 = r1147740 / r1147758;
        double r1147760 = r1147757 / r1147759;
        double r1147761 = 1.0;
        double r1147762 = exp(r1147743);
        double r1147763 = r1147740 * r1147762;
        double r1147764 = r1147761 / r1147763;
        double r1147765 = r1147748 ? r1147760 : r1147764;
        double r1147766 = r1147742 ? r1147746 : r1147765;
        return r1147766;
}

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.9
Target7.9
Herbie0.4
\[\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 < -5.1279911066425243e+64

    1. Initial program 13.6

      \[\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 -5.1279911066425243e+64 < x < 3.5038509428931215e-13

    1. Initial program 10.7

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

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

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

      \[\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-prod2.4

      \[\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-in2.4

      \[\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-sum2.4

      \[\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*2.4

      \[\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. Simplified2.4

      \[\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}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}}\]
    11. Using strategy rm
    12. Applied add-sqr-sqrt2.4

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

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

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

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

    if 3.5038509428931215e-13 < x

    1. Initial program 9.3

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

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

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

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

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

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

Reproduce

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

  :herbie-target
  (if (< y -3.7311844206647956e+94) (/ (exp (/ -1.0 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.0 y)) x))))

  (/ (exp (* x (log (/ x (+ x y))))) x))