Average Error: 0.6 → 0.5
Time: 2.7s
Precision: 64
\[\frac{e^{a}}{e^{a} + e^{b}}\]
\[e^{\sqrt[3]{{\left(a - \log \left(e^{a} + e^{b}\right)\right)}^{3}}}\]
\frac{e^{a}}{e^{a} + e^{b}}
e^{\sqrt[3]{{\left(a - \log \left(e^{a} + e^{b}\right)\right)}^{3}}}
double f(double a, double b) {
        double r190047 = a;
        double r190048 = exp(r190047);
        double r190049 = b;
        double r190050 = exp(r190049);
        double r190051 = r190048 + r190050;
        double r190052 = r190048 / r190051;
        return r190052;
}

double f(double a, double b) {
        double r190053 = a;
        double r190054 = exp(r190053);
        double r190055 = b;
        double r190056 = exp(r190055);
        double r190057 = r190054 + r190056;
        double r190058 = log(r190057);
        double r190059 = r190053 - r190058;
        double r190060 = 3.0;
        double r190061 = pow(r190059, r190060);
        double r190062 = cbrt(r190061);
        double r190063 = exp(r190062);
        return r190063;
}

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.6
Target0.0
Herbie0.5
\[\frac{1}{1 + e^{b - a}}\]

Derivation

  1. Initial program 0.6

    \[\frac{e^{a}}{e^{a} + e^{b}}\]
  2. Using strategy rm
  3. Applied add-exp-log0.6

    \[\leadsto \frac{e^{a}}{\color{blue}{e^{\log \left(e^{a} + e^{b}\right)}}}\]
  4. Applied div-exp0.5

    \[\leadsto \color{blue}{e^{a - \log \left(e^{a} + e^{b}\right)}}\]
  5. Using strategy rm
  6. Applied add-cbrt-cube0.5

    \[\leadsto e^{\color{blue}{\sqrt[3]{\left(\left(a - \log \left(e^{a} + e^{b}\right)\right) \cdot \left(a - \log \left(e^{a} + e^{b}\right)\right)\right) \cdot \left(a - \log \left(e^{a} + e^{b}\right)\right)}}}\]
  7. Simplified0.5

    \[\leadsto e^{\sqrt[3]{\color{blue}{{\left(a - \log \left(e^{a} + e^{b}\right)\right)}^{3}}}}\]
  8. Final simplification0.5

    \[\leadsto e^{\sqrt[3]{{\left(a - \log \left(e^{a} + e^{b}\right)\right)}^{3}}}\]

Reproduce

herbie shell --seed 2020034 
(FPCore (a b)
  :name "Quotient of sum of exps"
  :precision binary64

  :herbie-target
  (/ 1 (+ 1 (exp (- b a))))

  (/ (exp a) (+ (exp a) (exp b))))