Average Error: 17.1 → 0.4
Time: 4.3s
Precision: 64
Internal precision: 384
\[\frac{e^{a}}{e^{a} + e^{b}}\]
\[e^{a - \log \left(e^{a} + e^{b}\right)}\]

Error

Bits error versus a

Bits error versus b

Target

Original17.1
Comparison14.2
Herbie0.4
\[ \frac{1}{1 + e^{b - a}} \]

Derivation

  1. Initial program 17.1

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

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

    \[\leadsto \color{blue}{e^{a - \log \left(e^{a} + e^{b}\right)}}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 4.3s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (a b)
  :name "Quotient of sum of exps"

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

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