Average Error: 11.0 → 0.2
Time: 19.1s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.575795415940148063364153542342468795089 \cdot 10^{92} \lor \neg \left(x \le 2.134762495789531033807406856794841587543\right):\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \left(\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -2.575795415940148063364153542342468795089 \cdot 10^{92} \lor \neg \left(x \le 2.134762495789531033807406856794841587543\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r274618 = x;
        double r274619 = y;
        double r274620 = r274618 + r274619;
        double r274621 = r274618 / r274620;
        double r274622 = log(r274621);
        double r274623 = r274618 * r274622;
        double r274624 = exp(r274623);
        double r274625 = r274624 / r274618;
        return r274625;
}

double f(double x, double y) {
        double r274626 = x;
        double r274627 = -2.575795415940148e+92;
        bool r274628 = r274626 <= r274627;
        double r274629 = 2.134762495789531;
        bool r274630 = r274626 <= r274629;
        double r274631 = !r274630;
        bool r274632 = r274628 || r274631;
        double r274633 = y;
        double r274634 = -r274633;
        double r274635 = exp(r274634);
        double r274636 = r274635 / r274626;
        double r274637 = cbrt(r274626);
        double r274638 = r274626 + r274633;
        double r274639 = cbrt(r274638);
        double r274640 = r274637 / r274639;
        double r274641 = log(r274640);
        double r274642 = r274641 + r274641;
        double r274643 = r274642 + r274641;
        double r274644 = r274626 * r274643;
        double r274645 = exp(r274644);
        double r274646 = r274645 / r274626;
        double r274647 = r274632 ? r274636 : r274646;
        return r274647;
}

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.0
Target7.5
Herbie0.2
\[\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 < -2.575795415940148e+92 or 2.134762495789531 < x

    1. Initial program 11.1

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

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

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

    if -2.575795415940148e+92 < x < 2.134762495789531

    1. Initial program 10.8

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt15.9

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{\color{blue}{\left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right) \cdot \sqrt[3]{x + y}}}\right)}}{x}\]
    4. Applied add-cube-cbrt10.9

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    5. Applied times-frac10.9

      \[\leadsto \frac{e^{x \cdot \log \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}\]
    6. Applied log-prod2.4

      \[\leadsto \frac{e^{x \cdot \color{blue}{\left(\log \left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}}{x}\]
    7. Using strategy rm
    8. Applied times-frac2.4

      \[\leadsto \frac{e^{x \cdot \left(\log \color{blue}{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)} + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\]
    9. Applied log-prod0.3

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

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

Reproduce

herbie shell --seed 2019208 +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.73118442066479561e94) (/ (exp (/ -1 y)) x) (if (< y 2.81795924272828789e37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))

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