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 code(double a, double b) {
	return (exp(a) / (exp(a) + exp(b)));
}
double code(double a, double b) {
	return exp(cbrt(pow((a - log((exp(a) + exp(b)))), 3.0)));
}

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