Average Error: 11.0 → 0.2
Time: 19.1s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.575795415940148063364153542342468795089 \cdot 10^{92} \lor \neg \left(x \le 2.134762495789531033807406856794841587543\right):\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -2.575795415940148063364153542342468795089 \cdot 10^{92} \lor \neg \left(x \le 2.134762495789531033807406856794841587543\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r314249 = x;
        double r314250 = y;
        double r314251 = r314249 + r314250;
        double r314252 = r314249 / r314251;
        double r314253 = log(r314252);
        double r314254 = r314249 * r314253;
        double r314255 = exp(r314254);
        double r314256 = r314255 / r314249;
        return r314256;
}

double f(double x, double y) {
        double r314257 = x;
        double r314258 = -2.575795415940148e+92;
        bool r314259 = r314257 <= r314258;
        double r314260 = 2.134762495789531;
        bool r314261 = r314257 <= r314260;
        double r314262 = !r314261;
        bool r314263 = r314259 || r314262;
        double r314264 = y;
        double r314265 = -r314264;
        double r314266 = exp(r314265);
        double r314267 = r314266 / r314257;
        double r314268 = 2.0;
        double r314269 = cbrt(r314257);
        double r314270 = r314257 + r314264;
        double r314271 = cbrt(r314270);
        double r314272 = r314269 / r314271;
        double r314273 = log(r314272);
        double r314274 = r314268 * r314273;
        double r314275 = r314257 * r314274;
        double r314276 = exp(r314275);
        double r314277 = pow(r314272, r314257);
        double r314278 = r314257 / r314277;
        double r314279 = r314276 / r314278;
        double r314280 = r314263 ? r314267 : r314279;
        return r314280;
}

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.0
Target7.5
Herbie0.2
\[\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 < -2.575795415940148e+92 or 2.134762495789531 < x

    1. Initial program 11.1

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

      \[\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}\]

    if -2.575795415940148e+92 < x < 2.134762495789531

    1. Initial program 10.8

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt15.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.8

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

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

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

      \[\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}}}}\]
    9. Using strategy rm
    10. Applied add-exp-log37.6

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

      \[\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}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\]
    12. Applied prod-exp37.6

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

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

      \[\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}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\]
    15. Applied prod-exp37.6

      \[\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}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\]
    16. Applied div-exp37.6

      \[\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}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\]
    17. Applied pow-exp36.6

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

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

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

Reproduce

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

  :herbie-target
  (if (< y -3.73118442066479561e94) (/ (exp (/ -1 y)) x) (if (< y 2.81795924272828789e37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))

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