\[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-72} \lor \neg \left(y \leq 10^{-23}\right):\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}\\
\end{array}
\]
(FPCore (x y z t)
:precision binary64
(- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
↓
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1e-72) (not (<= y 1e-23)))
(- x (/ (log1p (* y (expm1 z))) t))
(- x (/ (expm1 z) (/ t y)))))
double code(double x, double y, double z, double t) {
return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
↓
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-72) || !(y <= 1e-23)) {
tmp = x - (log1p((y * expm1(z))) / t);
} else {
tmp = x - (expm1(z) / (t / y));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
↓
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-72) || !(y <= 1e-23)) {
tmp = x - (Math.log1p((y * Math.expm1(z))) / t);
} else {
tmp = x - (Math.expm1(z) / (t / y));
}
return tmp;
}
def code(x, y, z, t):
return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
↓
def code(x, y, z, t):
tmp = 0
if (y <= -1e-72) or not (y <= 1e-23):
tmp = x - (math.log1p((y * math.expm1(z))) / t)
else:
tmp = x - (math.expm1(z) / (t / y))
return tmp
function code(x, y, z, t)
return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
↓
function code(x, y, z, t)
tmp = 0.0
if ((y <= -1e-72) || !(y <= 1e-23))
tmp = Float64(x - Float64(log1p(Float64(y * expm1(z))) / t));
else
tmp = Float64(x - Float64(expm1(z) / Float64(t / y)));
end
return tmp
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-72], N[Not[LessEqual[y, 1e-23]], $MachinePrecision]], N[(x - N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(Exp[z] - 1), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
↓
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-72} \lor \neg \left(y \leq 10^{-23}\right):\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}\\
\end{array}