Average Error: 11.1 → 1.3
Time: 16.8s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.492398711199389821249051732784124501473 \cdot 10^{85} \lor \neg \left(x \le 1719139.2202338078059256076812744140625\right):\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -6.492398711199389821249051732784124501473 \cdot 10^{85} \lor \neg \left(x \le 1719139.2202338078059256076812744140625\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\

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

\end{array}
double f(double x, double y) {
        double r339009 = x;
        double r339010 = y;
        double r339011 = r339009 + r339010;
        double r339012 = r339009 / r339011;
        double r339013 = log(r339012);
        double r339014 = r339009 * r339013;
        double r339015 = exp(r339014);
        double r339016 = r339015 / r339009;
        return r339016;
}

double f(double x, double y) {
        double r339017 = x;
        double r339018 = -6.49239871119939e+85;
        bool r339019 = r339017 <= r339018;
        double r339020 = 1719139.2202338078;
        bool r339021 = r339017 <= r339020;
        double r339022 = !r339021;
        bool r339023 = r339019 || r339022;
        double r339024 = 1.0;
        double r339025 = y;
        double r339026 = exp(r339025);
        double r339027 = r339017 * r339026;
        double r339028 = r339024 / r339027;
        double r339029 = cbrt(r339017);
        double r339030 = r339029 * r339029;
        double r339031 = r339025 + r339017;
        double r339032 = cbrt(r339031);
        double r339033 = r339032 * r339032;
        double r339034 = r339030 / r339033;
        double r339035 = pow(r339034, r339017);
        double r339036 = r339029 / r339032;
        double r339037 = pow(r339036, r339017);
        double r339038 = r339017 / r339037;
        double r339039 = r339035 / r339038;
        double r339040 = r339023 ? r339028 : r339039;
        return r339040;
}

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.1
Target7.9
Herbie1.3
\[\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 < -6.49239871119939e+85 or 1719139.2202338078 < x

    1. Initial program 11.4

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

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

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

      \[\leadsto \frac{e^{\color{blue}{0 - y}}}{x}\]
    6. Applied exp-diff0.0

      \[\leadsto \frac{\color{blue}{\frac{e^{0}}{e^{y}}}}{x}\]
    7. Applied associate-/l/0.0

      \[\leadsto \color{blue}{\frac{e^{0}}{x \cdot e^{y}}}\]
    8. Simplified0.0

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

    if -6.49239871119939e+85 < x < 1719139.2202338078

    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}{y + x}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt15.2

      \[\leadsto \frac{{\left(\frac{x}{\color{blue}{\left(\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}\right) \cdot \sqrt[3]{y + x}}}\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]{y + x} \cdot \sqrt[3]{y + x}\right) \cdot \sqrt[3]{y + x}}\right)}^{x}}{x}\]
    6. Applied times-frac10.8

      \[\leadsto \frac{{\color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}}^{x}}{x}\]
    7. Applied unpow-prod-down2.4

      \[\leadsto \frac{\color{blue}{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}{x}\]
    8. Applied associate-/l*2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -6.492398711199389821249051732784124501473 \cdot 10^{85} \lor \neg \left(x \le 1719139.2202338078059256076812744140625\right):\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y -3.7311844206647956e+94) (/ (exp (/ -1.0 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.0 y)) x))))

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