Average Error: 10.9 → 5.3
Time: 12.4s
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^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x + 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^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x + 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 r1013485 = x;
        double r1013486 = y;
        double r1013487 = r1013485 + r1013486;
        double r1013488 = r1013485 / r1013487;
        double r1013489 = log(r1013488);
        double r1013490 = r1013485 * r1013489;
        double r1013491 = exp(r1013490);
        double r1013492 = r1013491 / r1013485;
        return r1013492;
}

double f(double x, double y) {
        double r1013493 = y;
        double r1013494 = 51088118733.37021;
        bool r1013495 = r1013493 <= r1013494;
        double r1013496 = 5.234179426754207e+118;
        bool r1013497 = r1013493 <= r1013496;
        double r1013498 = !r1013497;
        bool r1013499 = r1013495 || r1013498;
        double r1013500 = 2.0;
        double r1013501 = x;
        double r1013502 = cbrt(r1013501);
        double r1013503 = r1013501 + r1013493;
        double r1013504 = cbrt(r1013503);
        double r1013505 = r1013502 / r1013504;
        double r1013506 = log(r1013505);
        double r1013507 = r1013500 * r1013506;
        double r1013508 = r1013507 * r1013501;
        double r1013509 = r1013501 * r1013506;
        double r1013510 = r1013508 + r1013509;
        double r1013511 = exp(r1013510);
        double r1013512 = r1013511 / r1013501;
        double r1013513 = r1013501 - r1013493;
        double r1013514 = r1013503 * r1013513;
        double r1013515 = r1013501 / r1013514;
        double r1013516 = r1013515 * r1013513;
        double r1013517 = log(r1013516);
        double r1013518 = r1013501 * r1013517;
        double r1013519 = exp(r1013518);
        double r1013520 = r1013519 / r1013501;
        double r1013521 = r1013499 ? r1013512 : r1013520;
        return r1013521;
}

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