Math FPCore C Fortran Python Julia Wolfram TeX \[\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.05:\\
\;\;\;\;\log \left(e^{\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x)))) ↓
(FPCore (x)
:precision binary64
(if (<= x -1e-310)
1.0
(if (<= x 0.05)
(log (exp (/ (fmod (exp x) (sqrt (cos x))) (exp x))))
(exp (- x))))) double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
↓
double code(double x) {
double tmp;
if (x <= -1e-310) {
tmp = 1.0;
} else if (x <= 0.05) {
tmp = log(exp((fmod(exp(x), sqrt(cos(x))) / exp(x))));
} else {
tmp = exp(-x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
code = mod(exp(x), sqrt(cos(x))) * exp(-x)
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1d-310)) then
tmp = 1.0d0
else if (x <= 0.05d0) then
tmp = log(exp((mod(exp(x), sqrt(cos(x))) / exp(x))))
else
tmp = exp(-x)
end if
code = tmp
end function
def code(x):
return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
↓
def code(x):
tmp = 0
if x <= -1e-310:
tmp = 1.0
elif x <= 0.05:
tmp = math.log(math.exp((math.fmod(math.exp(x), math.sqrt(math.cos(x))) / math.exp(x))))
else:
tmp = math.exp(-x)
return tmp
function code(x)
return Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x)))
end
↓
function code(x)
tmp = 0.0
if (x <= -1e-310)
tmp = 1.0;
elseif (x <= 0.05)
tmp = log(exp(Float64(rem(exp(x), sqrt(cos(x))) / exp(x))));
else
tmp = exp(Float64(-x));
end
return tmp
end
code[x_] := N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
↓
code[x_] := If[LessEqual[x, -1e-310], 1.0, If[LessEqual[x, 0.05], N[Log[N[Exp[N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Exp[(-x)], $MachinePrecision]]]
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
↓
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.05:\\
\;\;\;\;\log \left(e^{\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
Alternatives Alternative 1 Error 36.91% Cost 39048
\[\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 200:\\
\;\;\;\;t_0 \cdot \left(\left(e^{x}\right) \bmod \left(\sqrt[3]{{\cos x}^{1.5}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 36.91% Cost 38984
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 200:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt[3]{{\cos x}^{1.5}}\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
Alternative 3 Error 36.91% Cost 32648
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 200:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot \frac{1}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
Alternative 4 Error 36.91% Cost 32584
\[\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 200:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 36.91% Cost 32520
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 200:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
Alternative 6 Error 37.13% Cost 20104
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-310}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.05:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(1 + \left(x \cdot x\right) \cdot -0.25\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
Alternative 7 Error 39.48% Cost 6528
\[e^{-x}
\]
Alternative 8 Error 56.82% Cost 64
\[1
\]