Average Error: 0.6 → 0.6
Time: 14.6s
Precision: 64
Internal Precision: 128
\[\frac{e^{a}}{e^{a} + e^{b}}\]
\[\log_* (1 + (e^{\frac{e^{a}}{e^{a} + e^{b}}} - 1)^*)\]

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

Derivation

  1. Initial program 0.6

    \[\frac{e^{a}}{e^{a} + e^{b}}\]
  2. Taylor expanded around inf 0.6

    \[\leadsto \color{blue}{\frac{e^{a}}{e^{b} + e^{a}}}\]
  3. Using strategy rm
  4. Applied log1p-expm1-u0.6

    \[\leadsto \color{blue}{\log_* (1 + (e^{\frac{e^{a}}{e^{b} + e^{a}}} - 1)^*)}\]
  5. Final simplification0.6

    \[\leadsto \log_* (1 + (e^{\frac{e^{a}}{e^{a} + e^{b}}} - 1)^*)\]

Runtime

Time bar (total: 14.6s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.60.60.60.00%
herbie shell --seed 2018354 +o rules:numerics
(FPCore (a b)
  :name "Quotient of sum of exps"

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

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