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

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

\end{array}
double f(double x, double y) {
        double r402822 = x;
        double r402823 = y;
        double r402824 = r402822 + r402823;
        double r402825 = r402822 / r402824;
        double r402826 = log(r402825);
        double r402827 = r402822 * r402826;
        double r402828 = exp(r402827);
        double r402829 = r402828 / r402822;
        return r402829;
}

double f(double x, double y) {
        double r402830 = y;
        double r402831 = 227.45691516776162;
        bool r402832 = r402830 <= r402831;
        double r402833 = 1.480529159109445e+146;
        bool r402834 = r402830 <= r402833;
        double r402835 = !r402834;
        bool r402836 = r402832 || r402835;
        double r402837 = x;
        double r402838 = 2.0;
        double r402839 = cbrt(r402837);
        double r402840 = r402837 + r402830;
        double r402841 = cbrt(r402840);
        double r402842 = r402839 / r402841;
        double r402843 = log(r402842);
        double r402844 = r402838 * r402843;
        double r402845 = r402844 + r402843;
        double r402846 = r402837 * r402845;
        double r402847 = exp(r402846);
        double r402848 = r402847 / r402837;
        double r402849 = 1.0;
        double r402850 = r402841 * r402841;
        double r402851 = r402849 / r402850;
        double r402852 = r402837 / r402841;
        double r402853 = r402851 * r402852;
        double r402854 = log(r402853);
        double r402855 = r402837 * r402854;
        double r402856 = exp(r402855);
        double r402857 = r402856 / r402837;
        double r402858 = r402836 ? r402848 : r402857;
        return r402858;
}

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.7
Herbie4.6
\[\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 < 227.45691516776162 or 1.480529159109445e+146 < y

    1. Initial program 7.8

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

      \[\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-cbrt7.8

      \[\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-frac7.8

      \[\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-prod3.5

      \[\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. Simplified2.1

      \[\leadsto \frac{e^{x \cdot \left(\color{blue}{2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)} + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\]

    if 227.45691516776162 < y < 1.480529159109445e+146

    1. Initial program 34.5

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

      \[\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 *-un-lft-identity23.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 227.4569151677616218876210041344165802002 \lor \neg \left(y \le 1.480529159109445059080956924684942271604 \cdot 10^{146}\right):\\ \;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \log \left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}} \cdot \frac{x}{\sqrt[3]{x + y}}\right)}}{x}\\ \end{array}\]

Reproduce

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