Average Error: 11.3 → 6.9
Time: 17.6s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;y \le 14.3367817113127866690547307371161878109:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\log \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{x + y}\right) \cdot x}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;y \le 14.3367817113127866690547307371161878109:\\
\;\;\;\;\frac{1}{x}\\

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

\end{array}
double f(double x, double y) {
        double r28737468 = x;
        double r28737469 = y;
        double r28737470 = r28737468 + r28737469;
        double r28737471 = r28737468 / r28737470;
        double r28737472 = log(r28737471);
        double r28737473 = r28737468 * r28737472;
        double r28737474 = exp(r28737473);
        double r28737475 = r28737474 / r28737468;
        return r28737475;
}

double f(double x, double y) {
        double r28737476 = y;
        double r28737477 = 14.336781711312787;
        bool r28737478 = r28737476 <= r28737477;
        double r28737479 = 1.0;
        double r28737480 = x;
        double r28737481 = r28737479 / r28737480;
        double r28737482 = cbrt(r28737480);
        double r28737483 = r28737482 * r28737482;
        double r28737484 = r28737480 + r28737476;
        double r28737485 = r28737482 / r28737484;
        double r28737486 = r28737483 * r28737485;
        double r28737487 = log(r28737486);
        double r28737488 = r28737487 * r28737480;
        double r28737489 = exp(r28737488);
        double r28737490 = r28737489 / r28737480;
        double r28737491 = r28737478 ? r28737481 : r28737490;
        return r28737491;
}

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.3
Target7.8
Herbie6.9
\[\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 y < 14.336781711312787

    1. Initial program 4.6

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Taylor expanded around inf 1.3

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

    if 14.336781711312787 < y

    1. Initial program 32.9

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity32.9

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{\color{blue}{1 \cdot \left(x + y\right)}}\right)}}{x}\]
    4. Applied add-cube-cbrt24.5

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot \left(x + y\right)}\right)}}{x}\]
    5. Applied times-frac25.0

      \[\leadsto \frac{e^{x \cdot \log \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \frac{\sqrt[3]{x}}{x + y}\right)}}}{x}\]
    6. Simplified25.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 14.3367817113127866690547307371161878109:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\log \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{x + y}\right) \cdot x}}{x}\\ \end{array}\]

Reproduce

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