
(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 13 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 (- (log1p (exp (- b a))))))
double code(double a, double b) {
return exp(-log1p(exp((b - a))));
}
public static double code(double a, double b) {
return Math.exp(-Math.log1p(Math.exp((b - a))));
}
def code(a, b): return math.exp(-math.log1p(math.exp((b - a))))
function code(a, b) return exp(Float64(-log1p(exp(Float64(b - a))))) end
code[a_, b_] := N[Exp[(-N[Log[1 + N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
e^{-\mathsf{log1p}\left(e^{b - a}\right)}
\end{array}
Initial program 99.2%
*-lft-identity99.2%
associate-*l/99.2%
associate-/r/99.2%
remove-double-neg99.2%
unsub-neg99.2%
div-sub71.1%
*-lft-identity71.1%
associate-*l/71.1%
lft-mult-inverse99.6%
sub-neg99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
(FPCore (a b) :precision binary64 (if (<= a -61000000.0) (exp a) (/ 1.0 (+ 1.0 (exp b)))))
double code(double a, double b) {
double tmp;
if (a <= -61000000.0) {
tmp = exp(a);
} 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 (a <= (-61000000.0d0)) then
tmp = exp(a)
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 (a <= -61000000.0) {
tmp = Math.exp(a);
} else {
tmp = 1.0 / (1.0 + Math.exp(b));
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -61000000.0: tmp = math.exp(a) else: tmp = 1.0 / (1.0 + math.exp(b)) return tmp
function code(a, b) tmp = 0.0 if (a <= -61000000.0) tmp = exp(a); else tmp = Float64(1.0 / Float64(1.0 + exp(b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -61000000.0) tmp = exp(a); else tmp = 1.0 / (1.0 + exp(b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -61000000.0], N[Exp[a], $MachinePrecision], N[(1.0 / N[(1.0 + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -61000000:\\
\;\;\;\;e^{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + e^{b}}\\
\end{array}
\end{array}
if a < -6.1e7Initial program 100.0%
Taylor expanded in b around 0 100.0%
rem-exp-log100.0%
log1p-undefine100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around inf 100.0%
if -6.1e7 < a Initial program 98.9%
*-lft-identity98.9%
associate-*l/98.9%
associate-/r/98.9%
remove-double-neg98.9%
unsub-neg98.9%
div-sub98.3%
*-lft-identity98.3%
associate-*l/98.3%
lft-mult-inverse99.4%
sub-neg99.4%
distribute-frac-neg99.4%
remove-double-neg99.4%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 98.7%
(FPCore (a b) :precision binary64 (/ 1.0 (+ (exp (- b a)) 1.0)))
double code(double a, double b) {
return 1.0 / (exp((b - a)) + 1.0);
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (exp((b - a)) + 1.0d0)
end function
public static double code(double a, double b) {
return 1.0 / (Math.exp((b - a)) + 1.0);
}
def code(a, b): return 1.0 / (math.exp((b - a)) + 1.0)
function code(a, b) return Float64(1.0 / Float64(exp(Float64(b - a)) + 1.0)) end
function tmp = code(a, b) tmp = 1.0 / (exp((b - a)) + 1.0); end
code[a_, b_] := N[(1.0 / N[(N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{e^{b - a} + 1}
\end{array}
Initial program 99.2%
*-lft-identity99.2%
associate-*l/99.2%
associate-/r/99.2%
remove-double-neg99.2%
unsub-neg99.2%
div-sub71.1%
*-lft-identity71.1%
associate-*l/71.1%
lft-mult-inverse99.6%
sub-neg99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
div-exp100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* b (* b 0.16666666666666666))))
(if (<= b -1.85e-10)
(exp a)
(if (<= b 9.5e+60)
(/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0))))
(if (<= b 2e+154)
(/
1.0
(+
2.0
(*
b
(+
1.0
(/ (- (* (* b 0.5) (* b 0.5)) (* t_0 t_0)) (- (* b 0.5) t_0))))))
(/ 1.0 (+ 2.0 (* b (+ 1.0 (* b 0.5))))))))))
double code(double a, double b) {
double t_0 = b * (b * 0.16666666666666666);
double tmp;
if (b <= -1.85e-10) {
tmp = exp(a);
} else if (b <= 9.5e+60) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else if (b <= 2e+154) {
tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0)))));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
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 = b * (b * 0.16666666666666666d0)
if (b <= (-1.85d-10)) then
tmp = exp(a)
else if (b <= 9.5d+60) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
else if (b <= 2d+154) then
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + ((((b * 0.5d0) * (b * 0.5d0)) - (t_0 * t_0)) / ((b * 0.5d0) - t_0)))))
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = b * (b * 0.16666666666666666);
double tmp;
if (b <= -1.85e-10) {
tmp = Math.exp(a);
} else if (b <= 9.5e+60) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else if (b <= 2e+154) {
tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0)))));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
def code(a, b): t_0 = b * (b * 0.16666666666666666) tmp = 0 if b <= -1.85e-10: tmp = math.exp(a) elif b <= 9.5e+60: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) elif b <= 2e+154: tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0))))) else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))) return tmp
function code(a, b) t_0 = Float64(b * Float64(b * 0.16666666666666666)) tmp = 0.0 if (b <= -1.85e-10) tmp = exp(a); elseif (b <= 9.5e+60) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); elseif (b <= 2e+154) tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(Float64(Float64(Float64(b * 0.5) * Float64(b * 0.5)) - Float64(t_0 * t_0)) / Float64(Float64(b * 0.5) - t_0)))))); else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
function tmp_2 = code(a, b) t_0 = b * (b * 0.16666666666666666); tmp = 0.0; if (b <= -1.85e-10) tmp = exp(a); elseif (b <= 9.5e+60) tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); elseif (b <= 2e+154) tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0))))); else tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(b * N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.85e-10], N[Exp[a], $MachinePrecision], If[LessEqual[b, 9.5e+60], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e+154], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(N[(N[(N[(b * 0.5), $MachinePrecision] * N[(b * 0.5), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(b * 0.5), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := b \cdot \left(b \cdot 0.16666666666666666\right)\\
\mathbf{if}\;b \leq -1.85 \cdot 10^{-10}:\\
\;\;\;\;e^{a}\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+60}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + \frac{\left(b \cdot 0.5\right) \cdot \left(b \cdot 0.5\right) - t\_0 \cdot t\_0}{b \cdot 0.5 - t\_0}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < -1.85000000000000007e-10Initial program 97.3%
Taylor expanded in b around 0 22.7%
rem-exp-log22.7%
log1p-undefine22.7%
div-exp22.7%
Simplified22.7%
Taylor expanded in a around inf 95.6%
if -1.85000000000000007e-10 < b < 9.49999999999999988e60Initial program 99.3%
*-lft-identity99.3%
associate-*l/99.3%
associate-/r/99.3%
remove-double-neg99.3%
unsub-neg99.3%
div-sub65.1%
*-lft-identity65.1%
associate-*l/65.1%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 96.9%
Taylor expanded in a around 0 87.6%
if 9.49999999999999988e60 < b < 2.00000000000000007e154Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub76.2%
*-lft-identity76.2%
associate-*l/76.2%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 56.4%
*-commutative56.4%
Simplified56.4%
distribute-lft-in56.4%
flip-+86.5%
Applied egg-rr86.5%
if 2.00000000000000007e154 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub72.5%
*-lft-identity72.5%
associate-*l/72.5%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification90.6%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* b (* b 0.16666666666666666))))
(if (<= b 6.2e+62)
(/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0))))
(if (<= b 2e+154)
(/
1.0
(+
2.0
(*
b
(+
1.0
(/ (- (* (* b 0.5) (* b 0.5)) (* t_0 t_0)) (- (* b 0.5) t_0))))))
(/ 1.0 (+ 2.0 (* b (+ 1.0 (* b 0.5)))))))))
double code(double a, double b) {
double t_0 = b * (b * 0.16666666666666666);
double tmp;
if (b <= 6.2e+62) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else if (b <= 2e+154) {
tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0)))));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
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 = b * (b * 0.16666666666666666d0)
if (b <= 6.2d+62) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
else if (b <= 2d+154) then
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + ((((b * 0.5d0) * (b * 0.5d0)) - (t_0 * t_0)) / ((b * 0.5d0) - t_0)))))
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = b * (b * 0.16666666666666666);
double tmp;
if (b <= 6.2e+62) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else if (b <= 2e+154) {
tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0)))));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
def code(a, b): t_0 = b * (b * 0.16666666666666666) tmp = 0 if b <= 6.2e+62: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) elif b <= 2e+154: tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0))))) else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))) return tmp
function code(a, b) t_0 = Float64(b * Float64(b * 0.16666666666666666)) tmp = 0.0 if (b <= 6.2e+62) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); elseif (b <= 2e+154) tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(Float64(Float64(Float64(b * 0.5) * Float64(b * 0.5)) - Float64(t_0 * t_0)) / Float64(Float64(b * 0.5) - t_0)))))); else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
function tmp_2 = code(a, b) t_0 = b * (b * 0.16666666666666666); tmp = 0.0; if (b <= 6.2e+62) tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); elseif (b <= 2e+154) tmp = 1.0 / (2.0 + (b * (1.0 + ((((b * 0.5) * (b * 0.5)) - (t_0 * t_0)) / ((b * 0.5) - t_0))))); else tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(b * N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 6.2e+62], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e+154], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(N[(N[(N[(b * 0.5), $MachinePrecision] * N[(b * 0.5), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(b * 0.5), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := b \cdot \left(b \cdot 0.16666666666666666\right)\\
\mathbf{if}\;b \leq 6.2 \cdot 10^{+62}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + \frac{\left(b \cdot 0.5\right) \cdot \left(b \cdot 0.5\right) - t\_0 \cdot t\_0}{b \cdot 0.5 - t\_0}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < 6.20000000000000029e62Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub70.2%
*-lft-identity70.2%
associate-*l/70.2%
lft-mult-inverse99.5%
sub-neg99.5%
distribute-frac-neg99.5%
remove-double-neg99.5%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 82.8%
Taylor expanded in a around 0 74.8%
if 6.20000000000000029e62 < b < 2.00000000000000007e154Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub76.2%
*-lft-identity76.2%
associate-*l/76.2%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 56.4%
*-commutative56.4%
Simplified56.4%
distribute-lft-in56.4%
flip-+86.5%
Applied egg-rr86.5%
if 2.00000000000000007e154 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub72.5%
*-lft-identity72.5%
associate-*l/72.5%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification79.7%
(FPCore (a b) :precision binary64 (if (<= b 2.6e+100) (/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0)))) (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b (+ 0.5 (* b 0.16666666666666666)))))))))
double code(double a, double b) {
double tmp;
if (b <= 2.6e+100) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 2.6d+100) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * (0.5d0 + (b * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 2.6e+100) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 2.6e+100: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666)))))) return tmp
function code(a, b) tmp = 0.0 if (b <= 2.6e+100) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(b * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 2.6e+100) tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); else tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 2.6e+100], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.6 \cdot 10^{+100}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if b < 2.6000000000000002e100Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub70.4%
*-lft-identity70.4%
associate-*l/70.4%
lft-mult-inverse99.5%
sub-neg99.5%
distribute-frac-neg99.5%
remove-double-neg99.5%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 80.6%
Taylor expanded in a around 0 72.5%
if 2.6000000000000002e100 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub73.6%
*-lft-identity73.6%
associate-*l/73.6%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 96.8%
*-commutative96.8%
Simplified96.8%
Final simplification77.5%
(FPCore (a b) :precision binary64 (if (<= b 4.3e+145) (/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0)))) (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b 0.5)))))))
double code(double a, double b) {
double tmp;
if (b <= 4.3e+145) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 4.3d+145) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 4.3e+145) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 4.3e+145: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))) return tmp
function code(a, b) tmp = 0.0 if (b <= 4.3e+145) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 4.3e+145) tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); else tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 4.3e+145], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.3 \cdot 10^{+145}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < 4.29999999999999998e145Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.1%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub70.7%
*-lft-identity70.7%
associate-*l/70.7%
lft-mult-inverse99.5%
sub-neg99.5%
distribute-frac-neg99.5%
remove-double-neg99.5%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 77.7%
Taylor expanded in a around 0 70.0%
if 4.29999999999999998e145 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub73.2%
*-lft-identity73.2%
associate-*l/73.2%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification74.4%
(FPCore (a b) :precision binary64 (if (<= b 4.3e+145) (/ 1.0 (+ 2.0 (* a (+ (* a (* a -0.16666666666666666)) -1.0)))) (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b 0.5)))))))
double code(double a, double b) {
double tmp;
if (b <= 4.3e+145) {
tmp = 1.0 / (2.0 + (a * ((a * (a * -0.16666666666666666)) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 4.3d+145) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (a * (-0.16666666666666666d0))) + (-1.0d0))))
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 4.3e+145) {
tmp = 1.0 / (2.0 + (a * ((a * (a * -0.16666666666666666)) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 4.3e+145: tmp = 1.0 / (2.0 + (a * ((a * (a * -0.16666666666666666)) + -1.0))) else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))) return tmp
function code(a, b) tmp = 0.0 if (b <= 4.3e+145) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(a * -0.16666666666666666)) + -1.0)))); else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 4.3e+145) tmp = 1.0 / (2.0 + (a * ((a * (a * -0.16666666666666666)) + -1.0))); else tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 4.3e+145], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.3 \cdot 10^{+145}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < 4.29999999999999998e145Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.1%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub70.7%
*-lft-identity70.7%
associate-*l/70.7%
lft-mult-inverse99.5%
sub-neg99.5%
distribute-frac-neg99.5%
remove-double-neg99.5%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 77.7%
Taylor expanded in a around 0 70.0%
Taylor expanded in a around inf 69.9%
*-commutative69.9%
Simplified69.9%
if 4.29999999999999998e145 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub73.2%
*-lft-identity73.2%
associate-*l/73.2%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification74.3%
(FPCore (a b) :precision binary64 (if (<= b 4.2e+130) (/ 1.0 (+ 2.0 (* a (+ (* a 0.5) -1.0)))) (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b 0.5)))))))
double code(double a, double b) {
double tmp;
if (b <= 4.2e+130) {
tmp = 1.0 / (2.0 + (a * ((a * 0.5) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 4.2d+130) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * 0.5d0) + (-1.0d0))))
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 4.2e+130) {
tmp = 1.0 / (2.0 + (a * ((a * 0.5) + -1.0)));
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 4.2e+130: tmp = 1.0 / (2.0 + (a * ((a * 0.5) + -1.0))) else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))) return tmp
function code(a, b) tmp = 0.0 if (b <= 4.2e+130) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * 0.5) + -1.0)))); else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 4.2e+130) tmp = 1.0 / (2.0 + (a * ((a * 0.5) + -1.0))); else tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 4.2e+130], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.2 \cdot 10^{+130}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot 0.5 + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < 4.19999999999999981e130Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub70.7%
*-lft-identity70.7%
associate-*l/70.7%
lft-mult-inverse99.5%
sub-neg99.5%
distribute-frac-neg99.5%
remove-double-neg99.5%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 78.2%
Taylor expanded in a around 0 66.5%
if 4.19999999999999981e130 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub72.7%
*-lft-identity72.7%
associate-*l/72.7%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 91.6%
*-commutative91.6%
Simplified91.6%
Final simplification70.8%
(FPCore (a b) :precision binary64 (/ 1.0 (+ 2.0 (* a (+ (* a 0.5) -1.0)))))
double code(double a, double b) {
return 1.0 / (2.0 + (a * ((a * 0.5) + -1.0)));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (2.0d0 + (a * ((a * 0.5d0) + (-1.0d0))))
end function
public static double code(double a, double b) {
return 1.0 / (2.0 + (a * ((a * 0.5) + -1.0)));
}
def code(a, b): return 1.0 / (2.0 + (a * ((a * 0.5) + -1.0)))
function code(a, b) return Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * 0.5) + -1.0)))) end
function tmp = code(a, b) tmp = 1.0 / (2.0 + (a * ((a * 0.5) + -1.0))); end
code[a_, b_] := N[(1.0 / N[(2.0 + N[(a * N[(N[(a * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{2 + a \cdot \left(a \cdot 0.5 + -1\right)}
\end{array}
Initial program 99.2%
*-lft-identity99.2%
associate-*l/99.2%
associate-/r/99.2%
remove-double-neg99.2%
unsub-neg99.2%
div-sub71.1%
*-lft-identity71.1%
associate-*l/71.1%
lft-mult-inverse99.6%
sub-neg99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 69.9%
Taylor expanded in a around 0 56.8%
Final simplification56.8%
(FPCore (a b) :precision binary64 (/ 1.0 (- 2.0 a)))
double code(double a, double b) {
return 1.0 / (2.0 - a);
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (2.0d0 - a)
end function
public static double code(double a, double b) {
return 1.0 / (2.0 - a);
}
def code(a, b): return 1.0 / (2.0 - a)
function code(a, b) return Float64(1.0 / Float64(2.0 - a)) end
function tmp = code(a, b) tmp = 1.0 / (2.0 - a); end
code[a_, b_] := N[(1.0 / N[(2.0 - a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{2 - a}
\end{array}
Initial program 99.2%
*-lft-identity99.2%
associate-*l/99.2%
associate-/r/99.2%
remove-double-neg99.2%
unsub-neg99.2%
div-sub71.1%
*-lft-identity71.1%
associate-*l/71.1%
lft-mult-inverse99.6%
sub-neg99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 69.9%
Taylor expanded in a around 0 42.7%
neg-mul-142.7%
unsub-neg42.7%
Simplified42.7%
(FPCore (a b) :precision binary64 (+ 0.5 (* a 0.25)))
double code(double a, double b) {
return 0.5 + (a * 0.25);
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 0.5d0 + (a * 0.25d0)
end function
public static double code(double a, double b) {
return 0.5 + (a * 0.25);
}
def code(a, b): return 0.5 + (a * 0.25)
function code(a, b) return Float64(0.5 + Float64(a * 0.25)) end
function tmp = code(a, b) tmp = 0.5 + (a * 0.25); end
code[a_, b_] := N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 + a \cdot 0.25
\end{array}
Initial program 99.2%
*-lft-identity99.2%
associate-*l/99.2%
associate-/r/99.2%
remove-double-neg99.2%
unsub-neg99.2%
div-sub71.1%
*-lft-identity71.1%
associate-*l/71.1%
lft-mult-inverse99.6%
sub-neg99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 69.9%
Taylor expanded in a around 0 41.8%
*-commutative41.8%
Simplified41.8%
(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 99.2%
*-lft-identity99.2%
associate-*l/99.2%
associate-/r/99.2%
remove-double-neg99.2%
unsub-neg99.2%
div-sub71.1%
*-lft-identity71.1%
associate-*l/71.1%
lft-mult-inverse99.6%
sub-neg99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 80.1%
Taylor expanded in b around 0 41.8%
(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 2024116
(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))))