\[\frac{e^{x} - e^{-x}}{2}
\]
↓
\[\begin{array}{l}
t_0 := e^{x} - e^{-x}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-7}\right):\\
\;\;\;\;\frac{t_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(x \cdot 0.3333333333333333\right)\right) + x \cdot 2}{2}\\
\end{array}
\]
(FPCore (x) :precision binary64 (/ (- (exp x) (exp (- x))) 2.0))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (- (exp x) (exp (- x)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 1e-7)))
(/ t_0 2.0)
(/ (+ (* x (* x (* x 0.3333333333333333))) (* x 2.0)) 2.0))))double code(double x) {
return (exp(x) - exp(-x)) / 2.0;
}
↓
double code(double x) {
double t_0 = exp(x) - exp(-x);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 1e-7)) {
tmp = t_0 / 2.0;
} else {
tmp = ((x * (x * (x * 0.3333333333333333))) + (x * 2.0)) / 2.0;
}
return tmp;
}
public static double code(double x) {
return (Math.exp(x) - Math.exp(-x)) / 2.0;
}
↓
public static double code(double x) {
double t_0 = Math.exp(x) - Math.exp(-x);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 1e-7)) {
tmp = t_0 / 2.0;
} else {
tmp = ((x * (x * (x * 0.3333333333333333))) + (x * 2.0)) / 2.0;
}
return tmp;
}
def code(x):
return (math.exp(x) - math.exp(-x)) / 2.0
↓
def code(x):
t_0 = math.exp(x) - math.exp(-x)
tmp = 0
if (t_0 <= -math.inf) or not (t_0 <= 1e-7):
tmp = t_0 / 2.0
else:
tmp = ((x * (x * (x * 0.3333333333333333))) + (x * 2.0)) / 2.0
return tmp
function code(x)
return Float64(Float64(exp(x) - exp(Float64(-x))) / 2.0)
end
↓
function code(x)
t_0 = Float64(exp(x) - exp(Float64(-x)))
tmp = 0.0
if ((t_0 <= Float64(-Inf)) || !(t_0 <= 1e-7))
tmp = Float64(t_0 / 2.0);
else
tmp = Float64(Float64(Float64(x * Float64(x * Float64(x * 0.3333333333333333))) + Float64(x * 2.0)) / 2.0);
end
return tmp
end
function tmp = code(x)
tmp = (exp(x) - exp(-x)) / 2.0;
end
↓
function tmp_2 = code(x)
t_0 = exp(x) - exp(-x);
tmp = 0.0;
if ((t_0 <= -Inf) || ~((t_0 <= 1e-7)))
tmp = t_0 / 2.0;
else
tmp = ((x * (x * (x * 0.3333333333333333))) + (x * 2.0)) / 2.0;
end
tmp_2 = tmp;
end
code[x_] := N[(N[(N[Exp[x], $MachinePrecision] - N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[(N[Exp[x], $MachinePrecision] - N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 1e-7]], $MachinePrecision]], N[(t$95$0 / 2.0), $MachinePrecision], N[(N[(N[(x * N[(x * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\frac{e^{x} - e^{-x}}{2}
↓
\begin{array}{l}
t_0 := e^{x} - e^{-x}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-7}\right):\\
\;\;\;\;\frac{t_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(x \cdot 0.3333333333333333\right)\right) + x \cdot 2}{2}\\
\end{array}