Average Error: 0.8 → 0.7
Time: 4.0s
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 r149798 = a;
        double r149799 = exp(r149798);
        double r149800 = b;
        double r149801 = exp(r149800);
        double r149802 = r149799 + r149801;
        double r149803 = r149799 / r149802;
        return r149803;
}

double f(double a, double b) {
        double r149804 = a;
        double r149805 = exp(r149804);
        double r149806 = b;
        double r149807 = exp(r149806);
        double r149808 = r149805 + r149807;
        double r149809 = log(r149808);
        double r149810 = r149804 - r149809;
        double r149811 = 3.0;
        double r149812 = pow(r149810, r149811);
        double r149813 = cbrt(r149812);
        double r149814 = exp(r149813);
        return r149814;
}

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 
(FPCore (a b)
  :name "Quotient of sum of exps"
  :precision binary64

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

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