
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b): return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / (exp(a) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b): return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / (exp(a) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}
(FPCore (a b) :precision binary64 (/ (exp a) (+ (/ 1.0 (exp (- a))) (exp b))))
double code(double a, double b) {
return exp(a) / ((1.0 / exp(-a)) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / ((1.0d0 / exp(-a)) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / ((1.0 / Math.exp(-a)) + Math.exp(b));
}
def code(a, b): return math.exp(a) / ((1.0 / math.exp(-a)) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(Float64(1.0 / exp(Float64(-a))) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / ((1.0 / exp(-a)) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[(1.0 / N[Exp[(-a)], $MachinePrecision]), $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{\frac{1}{e^{-a}} + e^{b}}
\end{array}
Initial program 98.8%
unpow1N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
lift-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6498.8
Applied rewrites98.8%
(FPCore (a b) :precision binary64 (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.0) (* b (* 0.0625 (* a a))) (fma 0.25 a 0.5)))
double code(double a, double b) {
double tmp;
if ((exp(a) / (exp(a) + exp(b))) <= 0.0) {
tmp = b * (0.0625 * (a * a));
} else {
tmp = fma(0.25, a, 0.5);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.0) tmp = Float64(b * Float64(0.0625 * Float64(a * a))); else tmp = fma(0.25, a, 0.5); end return tmp end
code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(b * N[(0.0625 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * a + 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0:\\
\;\;\;\;b \cdot \left(0.0625 \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25, a, 0.5\right)\\
\end{array}
\end{array}
if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.0Initial program 100.0%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites62.3%
Taylor expanded in a around 0
Applied rewrites2.0%
Taylor expanded in a around inf
Applied rewrites19.2%
if 0.0 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) Initial program 97.6%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites65.2%
Taylor expanded in a around 0
Applied rewrites63.9%
Taylor expanded in b around 0
Applied rewrites67.3%
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b): return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / (exp(a) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}
Initial program 98.8%
(FPCore (a b) :precision binary64 (if (<= (exp a) 0.0) (/ (exp a) (+ 1.0 1.0)) (/ 1.0 (+ 1.0 (exp b)))))
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.0) {
tmp = exp(a) / (1.0 + 1.0);
} else {
tmp = 1.0 / (1.0 + exp(b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.0d0) then
tmp = exp(a) / (1.0d0 + 1.0d0)
else
tmp = 1.0d0 / (1.0d0 + exp(b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = Math.exp(a) / (1.0 + 1.0);
} else {
tmp = 1.0 / (1.0 + Math.exp(b));
}
return tmp;
}
def code(a, b): tmp = 0 if math.exp(a) <= 0.0: tmp = math.exp(a) / (1.0 + 1.0) else: tmp = 1.0 / (1.0 + math.exp(b)) return tmp
function code(a, b) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(exp(a) / Float64(1.0 + 1.0)); else tmp = Float64(1.0 / Float64(1.0 + exp(b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (exp(a) <= 0.0) tmp = exp(a) / (1.0 + 1.0); else tmp = 1.0 / (1.0 + exp(b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(N[Exp[a], $MachinePrecision] / N[(1.0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{e^{a}}{1 + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + e^{b}}\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 100.0%
Taylor expanded in b around 0
Applied rewrites100.0%
Taylor expanded in a around 0
Applied rewrites100.0%
if 0.0 < (exp.f64 a) Initial program 98.3%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f6497.8
Applied rewrites97.8%
(FPCore (a b)
:precision binary64
(let* ((t_0 (/ 1.0 (+ 1.0 (exp b)))))
(if (<= a -3.5e+203)
t_0
(if (<= a -8.6e+141) (* -0.0020833333333333333 (pow b 5.0)) t_0))))
double code(double a, double b) {
double t_0 = 1.0 / (1.0 + exp(b));
double tmp;
if (a <= -3.5e+203) {
tmp = t_0;
} else if (a <= -8.6e+141) {
tmp = -0.0020833333333333333 * pow(b, 5.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (1.0d0 + exp(b))
if (a <= (-3.5d+203)) then
tmp = t_0
else if (a <= (-8.6d+141)) then
tmp = (-0.0020833333333333333d0) * (b ** 5.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = 1.0 / (1.0 + Math.exp(b));
double tmp;
if (a <= -3.5e+203) {
tmp = t_0;
} else if (a <= -8.6e+141) {
tmp = -0.0020833333333333333 * Math.pow(b, 5.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = 1.0 / (1.0 + math.exp(b)) tmp = 0 if a <= -3.5e+203: tmp = t_0 elif a <= -8.6e+141: tmp = -0.0020833333333333333 * math.pow(b, 5.0) else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(1.0 / Float64(1.0 + exp(b))) tmp = 0.0 if (a <= -3.5e+203) tmp = t_0; elseif (a <= -8.6e+141) tmp = Float64(-0.0020833333333333333 * (b ^ 5.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = 1.0 / (1.0 + exp(b)); tmp = 0.0; if (a <= -3.5e+203) tmp = t_0; elseif (a <= -8.6e+141) tmp = -0.0020833333333333333 * (b ^ 5.0); else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(1.0 / N[(1.0 + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.5e+203], t$95$0, If[LessEqual[a, -8.6e+141], N[(-0.0020833333333333333 * N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{1 + e^{b}}\\
\mathbf{if}\;a \leq -3.5 \cdot 10^{+203}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq -8.6 \cdot 10^{+141}:\\
\;\;\;\;-0.0020833333333333333 \cdot {b}^{5}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -3.50000000000000031e203 or -8.5999999999999997e141 < a Initial program 98.7%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f6487.3
Applied rewrites87.3%
if -3.50000000000000031e203 < a < -8.5999999999999997e141Initial program 100.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f6428.6
Applied rewrites28.6%
Applied rewrites28.6%
Taylor expanded in b around 0
Applied rewrites2.8%
Taylor expanded in b around inf
Applied rewrites74.1%
(FPCore (a b) :precision binary64 (if (<= a -8.6e+141) (* -0.0020833333333333333 (pow b 5.0)) (/ 1.0 (fma b (fma b (fma b 0.16666666666666666 0.5) 1.0) 2.0))))
double code(double a, double b) {
double tmp;
if (a <= -8.6e+141) {
tmp = -0.0020833333333333333 * pow(b, 5.0);
} else {
tmp = 1.0 / fma(b, fma(b, fma(b, 0.16666666666666666, 0.5), 1.0), 2.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= -8.6e+141) tmp = Float64(-0.0020833333333333333 * (b ^ 5.0)); else tmp = Float64(1.0 / fma(b, fma(b, fma(b, 0.16666666666666666, 0.5), 1.0), 2.0)); end return tmp end
code[a_, b_] := If[LessEqual[a, -8.6e+141], N[(-0.0020833333333333333 * N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(b * N[(b * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{+141}:\\
\;\;\;\;-0.0020833333333333333 \cdot {b}^{5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(b, \mathsf{fma}\left(b, 0.16666666666666666, 0.5\right), 1\right), 2\right)}\\
\end{array}
\end{array}
if a < -8.5999999999999997e141Initial program 100.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f6446.0
Applied rewrites46.0%
Applied rewrites46.0%
Taylor expanded in b around 0
Applied rewrites2.5%
Taylor expanded in b around inf
Applied rewrites50.5%
if -8.5999999999999997e141 < a Initial program 98.5%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f6492.4
Applied rewrites92.4%
Taylor expanded in b around 0
Applied rewrites59.8%
(FPCore (a b)
:precision binary64
(if (<= b 60000000000.0)
(fma 0.25 a 0.5)
(if (<= b 3.75e+102)
(* b (* 0.0625 (* a a)))
(/ 1.0 (fma b (fma b (fma b 0.16666666666666666 0.5) 1.0) 2.0)))))
double code(double a, double b) {
double tmp;
if (b <= 60000000000.0) {
tmp = fma(0.25, a, 0.5);
} else if (b <= 3.75e+102) {
tmp = b * (0.0625 * (a * a));
} else {
tmp = 1.0 / fma(b, fma(b, fma(b, 0.16666666666666666, 0.5), 1.0), 2.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (b <= 60000000000.0) tmp = fma(0.25, a, 0.5); elseif (b <= 3.75e+102) tmp = Float64(b * Float64(0.0625 * Float64(a * a))); else tmp = Float64(1.0 / fma(b, fma(b, fma(b, 0.16666666666666666, 0.5), 1.0), 2.0)); end return tmp end
code[a_, b_] := If[LessEqual[b, 60000000000.0], N[(0.25 * a + 0.5), $MachinePrecision], If[LessEqual[b, 3.75e+102], N[(b * N[(0.0625 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(b * N[(b * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 60000000000:\\
\;\;\;\;\mathsf{fma}\left(0.25, a, 0.5\right)\\
\mathbf{elif}\;b \leq 3.75 \cdot 10^{+102}:\\
\;\;\;\;b \cdot \left(0.0625 \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(b, \mathsf{fma}\left(b, 0.16666666666666666, 0.5\right), 1\right), 2\right)}\\
\end{array}
\end{array}
if b < 6e10Initial program 98.2%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites74.1%
Taylor expanded in a around 0
Applied rewrites48.2%
Taylor expanded in b around 0
Applied rewrites50.7%
if 6e10 < b < 3.75e102Initial program 100.0%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites27.9%
Taylor expanded in a around 0
Applied rewrites2.5%
Taylor expanded in a around inf
Applied rewrites31.7%
if 3.75e102 < b Initial program 100.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites98.5%
(FPCore (a b)
:precision binary64
(if (<= b 60000000000.0)
(fma 0.25 a 0.5)
(if (<= b 1.05e+153)
(* b (* 0.0625 (* a a)))
(/ 1.0 (fma b (fma b 0.5 1.0) 2.0)))))
double code(double a, double b) {
double tmp;
if (b <= 60000000000.0) {
tmp = fma(0.25, a, 0.5);
} else if (b <= 1.05e+153) {
tmp = b * (0.0625 * (a * a));
} else {
tmp = 1.0 / fma(b, fma(b, 0.5, 1.0), 2.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (b <= 60000000000.0) tmp = fma(0.25, a, 0.5); elseif (b <= 1.05e+153) tmp = Float64(b * Float64(0.0625 * Float64(a * a))); else tmp = Float64(1.0 / fma(b, fma(b, 0.5, 1.0), 2.0)); end return tmp end
code[a_, b_] := If[LessEqual[b, 60000000000.0], N[(0.25 * a + 0.5), $MachinePrecision], If[LessEqual[b, 1.05e+153], N[(b * N[(0.0625 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(b * 0.5 + 1.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 60000000000:\\
\;\;\;\;\mathsf{fma}\left(0.25, a, 0.5\right)\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+153}:\\
\;\;\;\;b \cdot \left(0.0625 \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(b, 0.5, 1\right), 2\right)}\\
\end{array}
\end{array}
if b < 6e10Initial program 98.2%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites74.1%
Taylor expanded in a around 0
Applied rewrites48.2%
Taylor expanded in b around 0
Applied rewrites50.7%
if 6e10 < b < 1.05000000000000008e153Initial program 100.0%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites37.8%
Taylor expanded in a around 0
Applied rewrites2.3%
Taylor expanded in a around inf
Applied rewrites27.6%
if 1.05000000000000008e153 < b Initial program 100.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in b around 0
Applied rewrites97.6%
(FPCore (a b) :precision binary64 (fma 0.25 a 0.5))
double code(double a, double b) {
return fma(0.25, a, 0.5);
}
function code(a, b) return fma(0.25, a, 0.5) end
code[a_, b_] := N[(0.25 * a + 0.5), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(0.25, a, 0.5\right)
\end{array}
Initial program 98.8%
Taylor expanded in b around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
times-fracN/A
distribute-lft1-inN/A
lower-*.f64N/A
Applied rewrites63.8%
Taylor expanded in a around 0
Applied rewrites33.2%
Taylor expanded in b around 0
Applied rewrites35.2%
(FPCore (a b) :precision binary64 0.5)
double code(double a, double b) {
return 0.5;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 0.5d0
end function
public static double code(double a, double b) {
return 0.5;
}
def code(a, b): return 0.5
function code(a, b) return 0.5 end
function tmp = code(a, b) tmp = 0.5; end
code[a_, b_] := 0.5
\begin{array}{l}
\\
0.5
\end{array}
Initial program 98.8%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-exp.f6483.0
Applied rewrites83.0%
Taylor expanded in b around 0
Applied rewrites35.1%
(FPCore (a b) :precision binary64 (/ 1.0 (+ 1.0 (exp (- b a)))))
double code(double a, double b) {
return 1.0 / (1.0 + exp((b - a)));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (1.0d0 + exp((b - a)))
end function
public static double code(double a, double b) {
return 1.0 / (1.0 + Math.exp((b - a)));
}
def code(a, b): return 1.0 / (1.0 + math.exp((b - a)))
function code(a, b) return Float64(1.0 / Float64(1.0 + exp(Float64(b - a)))) end
function tmp = code(a, b) tmp = 1.0 / (1.0 + exp((b - a))); end
code[a_, b_] := N[(1.0 / N[(1.0 + N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{1 + e^{b - a}}
\end{array}
herbie shell --seed 2024231
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:alt
(! :herbie-platform default (/ 1 (+ 1 (exp (- b a)))))
(/ (exp a) (+ (exp a) (exp b))))