Average Error: 10.9 → 0.3
Time: 1.1m
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -9603720562144241244067922519785472:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \mathbf{elif}\;x \le 6.305809243265488292923253978118289242438 \cdot 10^{-10}:\\ \;\;\;\;\frac{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}}{x} \cdot e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-y}}{x}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -9603720562144241244067922519785472:\\
\;\;\;\;\frac{e^{-y}}{x}\\

\mathbf{elif}\;x \le 6.305809243265488292923253978118289242438 \cdot 10^{-10}:\\
\;\;\;\;\frac{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}}{x} \cdot e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right) \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\

\end{array}
double f(double x, double y) {
        double r18632464 = x;
        double r18632465 = y;
        double r18632466 = r18632464 + r18632465;
        double r18632467 = r18632464 / r18632466;
        double r18632468 = log(r18632467);
        double r18632469 = r18632464 * r18632468;
        double r18632470 = exp(r18632469);
        double r18632471 = r18632470 / r18632464;
        return r18632471;
}

double f(double x, double y) {
        double r18632472 = x;
        double r18632473 = -9.603720562144241e+33;
        bool r18632474 = r18632472 <= r18632473;
        double r18632475 = y;
        double r18632476 = -r18632475;
        double r18632477 = exp(r18632476);
        double r18632478 = r18632477 / r18632472;
        double r18632479 = 6.305809243265488e-10;
        bool r18632480 = r18632472 <= r18632479;
        double r18632481 = cbrt(r18632472);
        double r18632482 = r18632475 + r18632472;
        double r18632483 = cbrt(r18632482);
        double r18632484 = r18632481 / r18632483;
        double r18632485 = log(r18632484);
        double r18632486 = r18632472 * r18632485;
        double r18632487 = exp(r18632486);
        double r18632488 = r18632487 / r18632472;
        double r18632489 = r18632485 + r18632485;
        double r18632490 = r18632489 * r18632472;
        double r18632491 = exp(r18632490);
        double r18632492 = r18632488 * r18632491;
        double r18632493 = r18632480 ? r18632492 : r18632478;
        double r18632494 = r18632474 ? r18632478 : r18632493;
        return r18632494;
}

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.8
Herbie0.3
\[\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 < -9.603720562144241e+33 or 6.305809243265488e-10 < x

    1. Initial program 11.4

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

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

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

    if -9.603720562144241e+33 < x < 6.305809243265488e-10

    1. Initial program 10.4

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

      \[\leadsto \frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{\color{blue}{1 \cdot x}}\]
    4. Applied add-cube-cbrt12.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)}}{1 \cdot x}\]
    5. Applied add-cube-cbrt10.4

      \[\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)}}{1 \cdot x}\]
    6. Applied times-frac10.4

      \[\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)}}}{1 \cdot x}\]
    7. Applied log-prod1.9

      \[\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)}}}{1 \cdot x}\]
    8. Applied distribute-lft-in1.9

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

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

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

      \[\leadsto \color{blue}{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}} \cdot \frac{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\]
    12. Using strategy rm
    13. Applied log-prod0.2

      \[\leadsto e^{x \cdot \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)}} \cdot \frac{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

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

Reproduce

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