Average Error: 11.6 → 5.2
Time: 6.3s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \le 1077.4618968781419 \lor \neg \left(y \le 4.93738979423122685 \cdot 10^{97}\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 \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{x}\right)\right)}{\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}\;y \le 1077.4618968781419 \lor \neg \left(y \le 4.93738979423122685 \cdot 10^{97}\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 \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)}}{x}\\

\end{array}
double f(double x, double y) {
        double r424408 = x;
        double r424409 = y;
        double r424410 = r424408 + r424409;
        double r424411 = r424408 / r424410;
        double r424412 = log(r424411);
        double r424413 = r424408 * r424412;
        double r424414 = exp(r424413);
        double r424415 = r424414 / r424408;
        return r424415;
}

double f(double x, double y) {
        double r424416 = y;
        double r424417 = 1077.461896878142;
        bool r424418 = r424416 <= r424417;
        double r424419 = 4.937389794231227e+97;
        bool r424420 = r424416 <= r424419;
        double r424421 = !r424420;
        bool r424422 = r424418 || r424421;
        double r424423 = x;
        double r424424 = 2.0;
        double r424425 = cbrt(r424423);
        double r424426 = r424423 + r424416;
        double r424427 = cbrt(r424426);
        double r424428 = r424425 / r424427;
        double r424429 = log(r424428);
        double r424430 = r424424 * r424429;
        double r424431 = r424423 * r424430;
        double r424432 = r424423 * r424429;
        double r424433 = r424431 + r424432;
        double r424434 = exp(r424433);
        double r424435 = r424434 / r424423;
        double r424436 = expm1(r424425);
        double r424437 = log1p(r424436);
        double r424438 = r424437 / r424427;
        double r424439 = log(r424438);
        double r424440 = r424423 * r424439;
        double r424441 = r424431 + r424440;
        double r424442 = exp(r424441);
        double r424443 = r424442 / r424423;
        double r424444 = r424422 ? r424435 : r424443;
        return r424444;
}

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.6
Target8.1
Herbie5.2
\[\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 < 1077.461896878142 or 4.937389794231227e+97 < y

    1. Initial program 9.2

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

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

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

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

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

      \[\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 1077.461896878142 < y < 4.937389794231227e+97

    1. Initial program 36.4

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt22.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-cbrt36.4

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

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

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

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

      \[\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}\]
    9. Using strategy rm
    10. Applied log1p-expm1-u23.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 1077.4618968781419 \lor \neg \left(y \le 4.93738979423122685 \cdot 10^{97}\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 \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)}}{x}\\ \end{array}\]

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(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))