Average Error: 0.8 → 0.7
Time: 4.3s
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 r165412 = a;
        double r165413 = exp(r165412);
        double r165414 = b;
        double r165415 = exp(r165414);
        double r165416 = r165413 + r165415;
        double r165417 = r165413 / r165416;
        return r165417;
}

double f(double a, double b) {
        double r165418 = a;
        double r165419 = exp(r165418);
        double r165420 = b;
        double r165421 = exp(r165420);
        double r165422 = r165419 + r165421;
        double r165423 = log(r165422);
        double r165424 = r165418 - r165423;
        double r165425 = 3.0;
        double r165426 = pow(r165424, r165425);
        double r165427 = cbrt(r165426);
        double r165428 = exp(r165427);
        return r165428;
}

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.8
Target0.0
Herbie0.7
\[\frac{1}{1 + e^{b - a}}\]

Derivation

  1. Initial program 0.8

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020049 +o rules:numerics
(FPCore (a b)
  :name "Quotient of sum of exps"
  :precision binary64

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

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