Average Error: 10.9 → 1.0
Time: 21.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}{e^{y} \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\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}{e^{y} \cdot x}\\

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

\end{array}
double f(double x, double y) {
        double r299279 = x;
        double r299280 = y;
        double r299281 = r299279 + r299280;
        double r299282 = r299279 / r299281;
        double r299283 = log(r299282);
        double r299284 = r299279 * r299283;
        double r299285 = exp(r299284);
        double r299286 = r299285 / r299279;
        return r299286;
}

double f(double x, double y) {
        double r299287 = x;
        double r299288 = -1.335604954605443e+135;
        bool r299289 = r299287 <= r299288;
        double r299290 = 2.859517489315194e-25;
        bool r299291 = r299287 <= r299290;
        double r299292 = !r299291;
        bool r299293 = r299289 || r299292;
        double r299294 = 1.0;
        double r299295 = y;
        double r299296 = exp(r299295);
        double r299297 = r299296 * r299287;
        double r299298 = r299294 / r299297;
        double r299299 = cbrt(r299287);
        double r299300 = r299287 + r299295;
        double r299301 = cbrt(r299300);
        double r299302 = r299299 / r299301;
        double r299303 = pow(r299302, r299287);
        double r299304 = r299303 * r299303;
        double r299305 = r299287 / r299303;
        double r299306 = r299304 / r299305;
        double r299307 = r299293 ? r299298 : r299306;
        return r299307;
}

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 clear-num1.0

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{e^{-y}}}}\]
    6. Simplified1.0

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

    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 times-frac3.0

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

      \[\leadsto \frac{\color{blue}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\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}{e^{y} \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}}\\ \end{array}\]

Reproduce

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