Average Error: 11.1 → 0.3
Time: 16.7s
Precision: 64
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.120156288663160099262452246870941235987 \cdot 10^{50} \lor \neg \left(x \le \frac{2698076950201437}{2417851639229258349412352}\right):\\ \;\;\;\;\frac{e^{-1 \cdot y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{\frac{x}{\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{1}}}\\ \end{array}\]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.120156288663160099262452246870941235987 \cdot 10^{50} \lor \neg \left(x \le \frac{2698076950201437}{2417851639229258349412352}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\

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

\end{array}
double f(double x, double y) {
        double r343427 = x;
        double r343428 = y;
        double r343429 = r343427 + r343428;
        double r343430 = r343427 / r343429;
        double r343431 = log(r343430);
        double r343432 = r343427 * r343431;
        double r343433 = exp(r343432);
        double r343434 = r343433 / r343427;
        return r343434;
}

double f(double x, double y) {
        double r343435 = x;
        double r343436 = -4.12015628866316e+50;
        bool r343437 = r343435 <= r343436;
        double r343438 = 2698076950201437.0;
        double r343439 = 2.4178516392292583e+24;
        double r343440 = r343438 / r343439;
        bool r343441 = r343435 <= r343440;
        double r343442 = !r343441;
        bool r343443 = r343437 || r343442;
        double r343444 = -1.0;
        double r343445 = y;
        double r343446 = r343444 * r343445;
        double r343447 = exp(r343446);
        double r343448 = r343447 / r343435;
        double r343449 = cbrt(r343435);
        double r343450 = r343435 + r343445;
        double r343451 = cbrt(r343450);
        double r343452 = r343449 / r343451;
        double r343453 = log(r343452);
        double r343454 = r343453 + r343453;
        double r343455 = r343435 * r343454;
        double r343456 = exp(r343455);
        double r343457 = pow(r343452, r343435);
        double r343458 = 1.0;
        double r343459 = r343457 / r343458;
        double r343460 = r343435 / r343459;
        double r343461 = r343456 / r343460;
        double r343462 = r343443 ? r343448 : r343461;
        return r343462;
}

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.1
Target8.0
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 < -4.12015628866316e+50 or 1.1158984721914147e-09 < x

    1. Initial program 11.7

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

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

    if -4.12015628866316e+50 < x < 1.1158984721914147e-09

    1. Initial program 10.6

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

      \[\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.6

      \[\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.6

      \[\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.0

      \[\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. Applied distribute-lft-in2.0

      \[\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)}}}{x}\]
    8. Applied exp-sum2.0

      \[\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)}}}{x}\]
    9. Applied associate-/l*2.0

      \[\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)}}{\frac{x}{e^{x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}}}\]
    10. Simplified2.0

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

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

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

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

Reproduce

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