Average Error: 10.8 → 0.7
Time: 21.5s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.980242683664132068157952579233092791682 \cdot 10^{60} \lor \neg \left(x \le 8.738743363977151004581063748076582071774 \cdot 10^{-24}\right):\\ \;\;\;\;\frac{\sqrt[3]{e^{-y}} \cdot \sqrt[3]{e^{-y}}}{\frac{x}{\sqrt[3]{e^{-y}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}\right) \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.980242683664132068157952579233092791682 \cdot 10^{60} \lor \neg \left(x \le 8.738743363977151004581063748076582071774 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{\sqrt[3]{e^{-y}} \cdot \sqrt[3]{e^{-y}}}{\frac{x}{\sqrt[3]{e^{-y}}}}\\

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

\end{array}
double f(double x, double y) {
        double r293204 = x;
        double r293205 = y;
        double r293206 = r293204 + r293205;
        double r293207 = r293204 / r293206;
        double r293208 = log(r293207);
        double r293209 = r293204 * r293208;
        double r293210 = exp(r293209);
        double r293211 = r293210 / r293204;
        return r293211;
}

double f(double x, double y) {
        double r293212 = x;
        double r293213 = -4.980242683664132e+60;
        bool r293214 = r293212 <= r293213;
        double r293215 = 8.738743363977151e-24;
        bool r293216 = r293212 <= r293215;
        double r293217 = !r293216;
        bool r293218 = r293214 || r293217;
        double r293219 = y;
        double r293220 = -r293219;
        double r293221 = exp(r293220);
        double r293222 = cbrt(r293221);
        double r293223 = r293222 * r293222;
        double r293224 = r293212 / r293222;
        double r293225 = r293223 / r293224;
        double r293226 = cbrt(r293212);
        double r293227 = r293212 + r293219;
        double r293228 = cbrt(r293227);
        double r293229 = r293226 / r293228;
        double r293230 = pow(r293229, r293212);
        double r293231 = r293230 * r293230;
        double r293232 = r293231 * r293230;
        double r293233 = r293232 / r293212;
        double r293234 = r293218 ? r293225 : r293233;
        return r293234;
}

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.8
Target8.3
Herbie0.7
\[\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 < -4.980242683664132e+60 or 8.738743363977151e-24 < x

    1. Initial program 10.7

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

      \[\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 add-cube-cbrt1.1

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{e^{-y}} \cdot \sqrt[3]{e^{-y}}}{\frac{x}{\sqrt[3]{e^{-y}}}}}\]

    if -4.980242683664132e+60 < x < 8.738743363977151e-24

    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-cbrt13.9

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

      \[\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. Using strategy rm
    9. Applied times-frac2.3

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

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

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

Reproduce

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