Average Error: 10.8 → 0.6
Time: 20.1s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.980242683664132068157952579233092791682 \cdot 10^{60} \lor \neg \left(x \le 8.738743363977151004581063748076582071774 \cdot 10^{-24}\right):\\ \;\;\;\;\frac{1}{e^{y} \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.980242683664132068157952579233092791682 \cdot 10^{60} \lor \neg \left(x \le 8.738743363977151004581063748076582071774 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{1}{e^{y} \cdot x}\\

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

\end{array}
double f(double x, double y) {
        double r322293 = x;
        double r322294 = y;
        double r322295 = r322293 + r322294;
        double r322296 = r322293 / r322295;
        double r322297 = log(r322296);
        double r322298 = r322293 * r322297;
        double r322299 = exp(r322298);
        double r322300 = r322299 / r322293;
        return r322300;
}

double f(double x, double y) {
        double r322301 = x;
        double r322302 = -4.980242683664132e+60;
        bool r322303 = r322301 <= r322302;
        double r322304 = 8.738743363977151e-24;
        bool r322305 = r322301 <= r322304;
        double r322306 = !r322305;
        bool r322307 = r322303 || r322306;
        double r322308 = 1.0;
        double r322309 = y;
        double r322310 = exp(r322309);
        double r322311 = r322310 * r322301;
        double r322312 = r322308 / r322311;
        double r322313 = 2.0;
        double r322314 = cbrt(r322301);
        double r322315 = r322301 + r322309;
        double r322316 = cbrt(r322315);
        double r322317 = r322314 / r322316;
        double r322318 = log(r322317);
        double r322319 = r322313 * r322318;
        double r322320 = r322319 * r322301;
        double r322321 = exp(r322320);
        double r322322 = pow(r322317, r322301);
        double r322323 = r322321 * r322322;
        double r322324 = r322323 / r322301;
        double r322325 = r322307 ? r322312 : r322324;
        return r322325;
}

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
Target8.3
Herbie0.6
\[\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 2 regimes
  2. if x < -4.980242683664132e+60 or 8.738743363977151e-24 < x

    1. Initial program 10.7

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

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

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

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

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

    if -4.980242683664132e+60 < x < 8.738743363977151e-24

    1. Initial program 10.9

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt13.9

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

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

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

      \[\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. Using strategy rm
    9. Applied add-exp-log36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    10. Applied add-exp-log36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    11. Applied prod-exp36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    12. Applied add-exp-log36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    13. Applied add-exp-log36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    14. Applied prod-exp36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    15. Applied div-exp36.2

      \[\leadsto \frac{{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    16. Applied pow-exp35.2

      \[\leadsto \frac{\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 {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\]
    17. Simplified0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.980242683664132068157952579233092791682 \cdot 10^{60} \lor \neg \left(x \le 8.738743363977151004581063748076582071774 \cdot 10^{-24}\right):\\ \;\;\;\;\frac{1}{e^{y} \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \end{array}\]

Reproduce

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