Average Error: 0.8 → 0.8
Time: 3.3s
Precision: 64
\[\frac{e^{a}}{e^{a} + e^{b}}\]
\[\frac{e^{a}}{e^{a} + e^{b}}\]
\frac{e^{a}}{e^{a} + e^{b}}
\frac{e^{a}}{e^{a} + e^{b}}
double code(double a, double b) {
	return (exp(a) / (exp(a) + exp(b)));
}
double code(double a, double b) {
	return (exp(a) / (exp(a) + exp(b)));
}

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

Derivation

  1. Initial program 0.8

    \[\frac{e^{a}}{e^{a} + e^{b}}\]
  2. Final simplification0.8

    \[\leadsto \frac{e^{a}}{e^{a} + e^{b}}\]

Reproduce

herbie shell --seed 2020091 +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))))