Average Error: 10.9 → 5.3
Time: 12.5s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \le 51088118733.370209 \lor \neg \left(y \le 5.2341794267542068 \cdot 10^{118}\right):\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \log \left(\frac{x}{\left(x + y\right) \cdot \left(x - y\right)} \cdot \left(x - y\right)\right)}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \le 51088118733.370209 \lor \neg \left(y \le 5.2341794267542068 \cdot 10^{118}\right):\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \log \left(\frac{x}{\left(x + y\right) \cdot \left(x - y\right)} \cdot \left(x - y\right)\right)}}{x}\\

\end{array}
double f(double x, double y) {
        double r1135188 = x;
        double r1135189 = y;
        double r1135190 = r1135188 + r1135189;
        double r1135191 = r1135188 / r1135190;
        double r1135192 = log(r1135191);
        double r1135193 = r1135188 * r1135192;
        double r1135194 = exp(r1135193);
        double r1135195 = r1135194 / r1135188;
        return r1135195;
}

double f(double x, double y) {
        double r1135196 = y;
        double r1135197 = 51088118733.37021;
        bool r1135198 = r1135196 <= r1135197;
        double r1135199 = 5.234179426754207e+118;
        bool r1135200 = r1135196 <= r1135199;
        double r1135201 = !r1135200;
        bool r1135202 = r1135198 || r1135201;
        double r1135203 = x;
        double r1135204 = 2.0;
        double r1135205 = cbrt(r1135203);
        double r1135206 = r1135203 + r1135196;
        double r1135207 = cbrt(r1135206);
        double r1135208 = r1135205 / r1135207;
        double r1135209 = log(r1135208);
        double r1135210 = r1135204 * r1135209;
        double r1135211 = r1135203 * r1135210;
        double r1135212 = r1135203 * r1135209;
        double r1135213 = r1135211 + r1135212;
        double r1135214 = exp(r1135213);
        double r1135215 = r1135214 / r1135203;
        double r1135216 = r1135203 - r1135196;
        double r1135217 = r1135206 * r1135216;
        double r1135218 = r1135203 / r1135217;
        double r1135219 = r1135218 * r1135216;
        double r1135220 = log(r1135219);
        double r1135221 = r1135203 * r1135220;
        double r1135222 = exp(r1135221);
        double r1135223 = r1135222 / r1135203;
        double r1135224 = r1135202 ? r1135215 : r1135223;
        return r1135224;
}

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
Target8.2
Herbie5.3
\[\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 2 regimes
  2. if y < 51088118733.37021 or 5.234179426754207e+118 < y

    1. Initial program 8.4

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

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

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

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

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

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

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

    if 51088118733.37021 < y < 5.234179426754207e+118

    1. Initial program 34.8

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

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{\color{blue}{\frac{x \cdot x - y \cdot y}{x - y}}}\right)}}{x}\]
    4. Applied associate-/r/27.5

      \[\leadsto \frac{e^{x \cdot \log \color{blue}{\left(\frac{x}{x \cdot x - y \cdot y} \cdot \left(x - y\right)\right)}}}{x}\]
    5. Using strategy rm
    6. Applied difference-of-squares27.5

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

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

Reproduce

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