\[0 \leq s \land s \leq 1.0651631\]
\[\frac{1}{1 + e^{\frac{-x}{s}}}
\]
↓
\[\frac{1}{1 + {\left(e^{-1}\right)}^{\left(\frac{x}{s}\right)}}
\]
(FPCore (x s) :precision binary64 (/ 1.0 (+ 1.0 (exp (/ (- x) s)))))
↓
(FPCore (x s) :precision binary64 (/ 1.0 (+ 1.0 (pow (exp -1.0) (/ x s)))))
double code(double x, double s) {
return 1.0 / (1.0 + exp((-x / s)));
}
↓
double code(double x, double s) {
return 1.0 / (1.0 + pow(exp(-1.0), (x / s)));
}
real(8) function code(x, s)
real(8), intent (in) :: x
real(8), intent (in) :: s
code = 1.0d0 / (1.0d0 + exp((-x / s)))
end function
↓
real(8) function code(x, s)
real(8), intent (in) :: x
real(8), intent (in) :: s
code = 1.0d0 / (1.0d0 + (exp((-1.0d0)) ** (x / s)))
end function
public static double code(double x, double s) {
return 1.0 / (1.0 + Math.exp((-x / s)));
}
↓
public static double code(double x, double s) {
return 1.0 / (1.0 + Math.pow(Math.exp(-1.0), (x / s)));
}
def code(x, s):
return 1.0 / (1.0 + math.exp((-x / s)))
↓
def code(x, s):
return 1.0 / (1.0 + math.pow(math.exp(-1.0), (x / s)))
function code(x, s)
return Float64(1.0 / Float64(1.0 + exp(Float64(Float64(-x) / s))))
end
↓
function code(x, s)
return Float64(1.0 / Float64(1.0 + (exp(-1.0) ^ Float64(x / s))))
end
function tmp = code(x, s)
tmp = 1.0 / (1.0 + exp((-x / s)));
end
↓
function tmp = code(x, s)
tmp = 1.0 / (1.0 + (exp(-1.0) ^ (x / s)));
end
code[x_, s_] := N[(1.0 / N[(1.0 + N[Exp[N[((-x) / s), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, s_] := N[(1.0 / N[(1.0 + N[Power[N[Exp[-1.0], $MachinePrecision], N[(x / s), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{1 + e^{\frac{-x}{s}}}
↓
\frac{1}{1 + {\left(e^{-1}\right)}^{\left(\frac{x}{s}\right)}}
Alternatives
| Alternative 1 |
|---|
| Error | 1.0 |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq -5 \cdot 10^{-298}:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{x}{s}}}{1 - -1}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.0 |
|---|
| Cost | 6976 |
|---|
\[\frac{1}{1 + \frac{1}{e^{\frac{x}{s}}}}
\]
| Alternative 3 |
|---|
| Error | 0.0 |
|---|
| Cost | 6912 |
|---|
\[\frac{1}{1 + e^{\frac{-x}{s}}}
\]
| Alternative 4 |
|---|
| Error | 3.8 |
|---|
| Cost | 2252 |
|---|
\[\begin{array}{l}
t_0 := \frac{s - x}{s}\\
\mathbf{if}\;-x \leq 5 \cdot 10^{-188}:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{elif}\;-x \leq 10^{-60}:\\
\;\;\;\;\frac{1}{\begin{array}{l}
\mathbf{if}\;t_0 \ne 0:\\
\;\;\;\;t_0 \cdot \left(1 + \left(\left(1 + \frac{x \cdot x}{s \cdot s}\right) + \frac{x}{s}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 - \frac{x}{s}\\
\end{array}}\\
\mathbf{else}:\\
\;\;\;\;3 - \left(3 + \frac{1}{\frac{x}{s}}\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 3.8 |
|---|
| Cost | 1480 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq 5 \cdot 10^{-188}:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{elif}\;-x \leq 10^{-60}:\\
\;\;\;\;\frac{1}{1 + \left(\left(\frac{x \cdot x}{s \cdot s} - \frac{x}{s}\right) - -1\right)}\\
\mathbf{else}:\\
\;\;\;\;3 - \left(3 + \frac{1}{\frac{x}{s}}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 8.3 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq -1 \cdot 10^{-171}:\\
\;\;\;\;\frac{1}{1 + \frac{s}{x}}\\
\mathbf{elif}\;-x \leq 10^{-172}:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;3 - \left(3 + \frac{1}{\frac{x}{s}}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 4.8 |
|---|
| Cost | 900 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq 10^{-172}:\\
\;\;\;\;\frac{1}{1 + \frac{1}{1 + \frac{x}{s}}}\\
\mathbf{else}:\\
\;\;\;\;3 - \left(3 + \frac{1}{\frac{x}{s}}\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 19.1 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq -1 \cdot 10^{-171}:\\
\;\;\;\;\frac{x - s}{x}\\
\mathbf{elif}\;-x \leq 4 \cdot 10^{-26}:\\
\;\;\;\;0.5 + \frac{0.25 \cdot x}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 18.9 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq -1 \cdot 10^{-171}:\\
\;\;\;\;\frac{1}{1 + \frac{s}{x}}\\
\mathbf{elif}\;-x \leq 4 \cdot 10^{-26}:\\
\;\;\;\;0.5 + \frac{0.25 \cdot x}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 19.2 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;-x \leq -2 \cdot 10^{-112}:\\
\;\;\;\;\frac{x - s}{x}\\
\mathbf{elif}\;-x \leq 4 \cdot 10^{-26}:\\
\;\;\;\;0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 18.9 |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{-172}:\\
\;\;\;\;\frac{1}{2 - \frac{x}{s}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \frac{s}{x}}\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 35.3 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\frac{x}{s}}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 35.6 |
|---|
| Cost | 388 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{s}{-x}\\
\mathbf{else}:\\
\;\;\;\;0.5\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 43.4 |
|---|
| Cost | 64 |
|---|
\[0.5
\]