\[\left(2.328306437 \cdot 10^{-10} \leq u \land u \leq 1\right) \land \left(0 \leq s \land s \leq 1.0651631\right)\]
\[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right)
\]
↓
\[\begin{array}{l}
t_0 := e^{-\mathsf{log1p}\left(e^{\frac{\pi}{s}}\right)}\\
t_1 := \left(t_0 - e^{-\mathsf{log1p}\left(e^{\frac{\pi}{-s}}\right)}\right) \cdot u - t_0\\
\left(-s\right) \cdot \log \left(\frac{-1 - t_1}{t_1}\right)
\end{array}
\]
(FPCore (u s)
:precision binary64
(*
(- s)
(log
(-
(/
1.0
(+
(*
u
(- (/ 1.0 (+ 1.0 (exp (/ (- PI) s)))) (/ 1.0 (+ 1.0 (exp (/ PI s))))))
(/ 1.0 (+ 1.0 (exp (/ PI s))))))
1.0))))↓
(FPCore (u s)
:precision binary64
(let* ((t_0 (exp (- (log1p (exp (/ PI s))))))
(t_1 (- (* (- t_0 (exp (- (log1p (exp (/ PI (- s))))))) u) t_0)))
(* (- s) (log (/ (- -1.0 t_1) t_1)))))double code(double u, double s) {
return -s * log(((1.0 / ((u * ((1.0 / (1.0 + exp((-((double) M_PI) / s)))) - (1.0 / (1.0 + exp((((double) M_PI) / s)))))) + (1.0 / (1.0 + exp((((double) M_PI) / s)))))) - 1.0));
}
↓
double code(double u, double s) {
double t_0 = exp(-log1p(exp((((double) M_PI) / s))));
double t_1 = ((t_0 - exp(-log1p(exp((((double) M_PI) / -s))))) * u) - t_0;
return -s * log(((-1.0 - t_1) / t_1));
}
public static double code(double u, double s) {
return -s * Math.log(((1.0 / ((u * ((1.0 / (1.0 + Math.exp((-Math.PI / s)))) - (1.0 / (1.0 + Math.exp((Math.PI / s)))))) + (1.0 / (1.0 + Math.exp((Math.PI / s)))))) - 1.0));
}
↓
public static double code(double u, double s) {
double t_0 = Math.exp(-Math.log1p(Math.exp((Math.PI / s))));
double t_1 = ((t_0 - Math.exp(-Math.log1p(Math.exp((Math.PI / -s))))) * u) - t_0;
return -s * Math.log(((-1.0 - t_1) / t_1));
}
def code(u, s):
return -s * math.log(((1.0 / ((u * ((1.0 / (1.0 + math.exp((-math.pi / s)))) - (1.0 / (1.0 + math.exp((math.pi / s)))))) + (1.0 / (1.0 + math.exp((math.pi / s)))))) - 1.0))
↓
def code(u, s):
t_0 = math.exp(-math.log1p(math.exp((math.pi / s))))
t_1 = ((t_0 - math.exp(-math.log1p(math.exp((math.pi / -s))))) * u) - t_0
return -s * math.log(((-1.0 - t_1) / t_1))
function code(u, s)
return Float64(Float64(-s) * log(Float64(Float64(1.0 / Float64(Float64(u * Float64(Float64(1.0 / Float64(1.0 + exp(Float64(Float64(-pi) / s)))) - Float64(1.0 / Float64(1.0 + exp(Float64(pi / s)))))) + Float64(1.0 / Float64(1.0 + exp(Float64(pi / s)))))) - 1.0)))
end
↓
function code(u, s)
t_0 = exp(Float64(-log1p(exp(Float64(pi / s)))))
t_1 = Float64(Float64(Float64(t_0 - exp(Float64(-log1p(exp(Float64(pi / Float64(-s))))))) * u) - t_0)
return Float64(Float64(-s) * log(Float64(Float64(-1.0 - t_1) / t_1)))
end
code[u_, s_] := N[((-s) * N[Log[N[(N[(1.0 / N[(N[(u * N[(N[(1.0 / N[(1.0 + N[Exp[N[((-Pi) / s), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(1.0 + N[Exp[N[(Pi / s), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Exp[N[(Pi / s), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[u_, s_] := Block[{t$95$0 = N[Exp[(-N[Log[1 + N[Exp[N[(Pi / s), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(t$95$0 - N[Exp[(-N[Log[1 + N[Exp[N[(Pi / (-s)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * u), $MachinePrecision] - t$95$0), $MachinePrecision]}, N[((-s) * N[Log[N[(N[(-1.0 - t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right)
↓
\begin{array}{l}
t_0 := e^{-\mathsf{log1p}\left(e^{\frac{\pi}{s}}\right)}\\
t_1 := \left(t_0 - e^{-\mathsf{log1p}\left(e^{\frac{\pi}{-s}}\right)}\right) \cdot u - t_0\\
\left(-s\right) \cdot \log \left(\frac{-1 - t_1}{t_1}\right)
\end{array}