Average Error: 10.9 → 1.0
Time: 23.2s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.335604954605443015390054065360569803049 \cdot 10^{135} \lor \neg \left(x \le 2.859517489315194049442510563430033342003 \cdot 10^{-25}\right):\\ \;\;\;\;\frac{1}{x \cdot e^{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{x} \cdot {\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{x}}{\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 -1.335604954605443015390054065360569803049 \cdot 10^{135} \lor \neg \left(x \le 2.859517489315194049442510563430033342003 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\

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

\end{array}
double f(double x, double y) {
        double r228185 = x;
        double r228186 = y;
        double r228187 = r228185 + r228186;
        double r228188 = r228185 / r228187;
        double r228189 = log(r228188);
        double r228190 = r228185 * r228189;
        double r228191 = exp(r228190);
        double r228192 = r228191 / r228185;
        return r228192;
}

double f(double x, double y) {
        double r228193 = x;
        double r228194 = -1.335604954605443e+135;
        bool r228195 = r228193 <= r228194;
        double r228196 = 2.859517489315194e-25;
        bool r228197 = r228193 <= r228196;
        double r228198 = !r228197;
        bool r228199 = r228195 || r228198;
        double r228200 = 1.0;
        double r228201 = y;
        double r228202 = exp(r228201);
        double r228203 = r228193 * r228202;
        double r228204 = r228200 / r228203;
        double r228205 = cbrt(r228193);
        double r228206 = r228193 + r228201;
        double r228207 = cbrt(r228206);
        double r228208 = r228205 / r228207;
        double r228209 = fabs(r228208);
        double r228210 = pow(r228209, r228193);
        double r228211 = r228210 * r228210;
        double r228212 = pow(r228208, r228193);
        double r228213 = r228193 / r228212;
        double r228214 = r228211 / r228213;
        double r228215 = r228199 ? r228204 : r228214;
        return r228215;
}

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
Target7.9
Herbie1.0
\[\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 < -1.335604954605443e+135 or 2.859517489315194e-25 < x

    1. Initial program 10.9

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

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

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

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

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

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

    if -1.335604954605443e+135 < x < 2.859517489315194e-25

    1. Initial program 10.9

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt17.8

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

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

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

      \[\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*3.0

      \[\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-sqr-sqrt3.0

      \[\leadsto \frac{{\color{blue}{\left(\sqrt{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}} \cdot \sqrt{\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}}}\]
    11. Applied unpow-prod-down3.0

      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}}\right)}^{x} \cdot {\left(\sqrt{\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}}}\]
    12. Simplified3.0

      \[\leadsto \frac{\color{blue}{{\left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right|\right)}^{x}} \cdot {\left(\sqrt{\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}}}\]
    13. Simplified1.0

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

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

Reproduce

herbie shell --seed 2019325 +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))