Average Error: 0.6 → 0.5
Time: 2.8s
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 r134464 = a;
        double r134465 = exp(r134464);
        double r134466 = b;
        double r134467 = exp(r134466);
        double r134468 = r134465 + r134467;
        double r134469 = r134465 / r134468;
        return r134469;
}

double f(double a, double b) {
        double r134470 = a;
        double r134471 = exp(r134470);
        double r134472 = b;
        double r134473 = exp(r134472);
        double r134474 = r134471 + r134473;
        double r134475 = log(r134474);
        double r134476 = r134470 - r134475;
        double r134477 = 3.0;
        double r134478 = pow(r134476, r134477);
        double r134479 = cbrt(r134478);
        double r134480 = exp(r134479);
        return r134480;
}

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 +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))))