\[\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\]
↓
\[\begin{array}{l}
t_0 := \mathsf{expm1}\left(\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x\right)\\
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\frac{1 - {t_0}^{2}}{1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (expm1 (- (log (fmod (exp x) (sqrt (cos x)))) x))))
(if (<= x -5.165282355235896e-302)
1.0
(if (<= x 3.583668735255346)
(/ (- 1.0 (pow t_0 2.0)) (- 1.0 t_0))
(exp (- x))))))double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
↓
double code(double x) {
double t_0 = expm1((log(fmod(exp(x), sqrt(cos(x)))) - x));
double tmp;
if (x <= -5.165282355235896e-302) {
tmp = 1.0;
} else if (x <= 3.583668735255346) {
tmp = (1.0 - pow(t_0, 2.0)) / (1.0 - t_0);
} else {
tmp = exp(-x);
}
return tmp;
}
def code(x):
return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
↓
def code(x):
t_0 = math.expm1((math.log(math.fmod(math.exp(x), math.sqrt(math.cos(x)))) - x))
tmp = 0
if x <= -5.165282355235896e-302:
tmp = 1.0
elif x <= 3.583668735255346:
tmp = (1.0 - math.pow(t_0, 2.0)) / (1.0 - t_0)
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)
t_0 = expm1(Float64(log(rem(exp(x), sqrt(cos(x)))) - x))
tmp = 0.0
if (x <= -5.165282355235896e-302)
tmp = 1.0;
elseif (x <= 3.583668735255346)
tmp = Float64(Float64(1.0 - (t_0 ^ 2.0)) / Float64(1.0 - t_0));
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_] := Block[{t$95$0 = N[(Exp[N[(N[Log[N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]], $MachinePrecision] - x), $MachinePrecision]] - 1), $MachinePrecision]}, If[LessEqual[x, -5.165282355235896e-302], 1.0, If[LessEqual[x, 3.583668735255346], N[(N[(1.0 - N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[Exp[(-x)], $MachinePrecision]]]]
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
↓
\begin{array}{l}
t_0 := \mathsf{expm1}\left(\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x\right)\\
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\frac{1 - {t_0}^{2}}{1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 24.5 |
|---|
| Cost | 71240 |
|---|
\[\begin{array}{l}
t_0 := \sqrt[3]{\cos x}\\
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 118.65353696607265:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt[3]{{\left({t_0}^{2}\right)}^{1.5} \cdot {t_0}^{1.5}}\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 24.5 |
|---|
| Cost | 64584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;e^{{\left(\sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x\right)\right)}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 24.5 |
|---|
| Cost | 39048 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;1 + \mathsf{expm1}\left(\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 24.5 |
|---|
| Cost | 38984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 118.65353696607265:\\
\;\;\;\;\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 5 |
|---|
| Error | 24.5 |
|---|
| Cost | 38920 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;e^{\log \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) - x}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 24.5 |
|---|
| Cost | 32520 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 24.6 |
|---|
| Cost | 26888 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 24.7 |
|---|
| Cost | 26376 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(\mathsf{fma}\left(x, x \cdot -0.25, 1\right)\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 24.7 |
|---|
| Cost | 26248 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 24.7 |
|---|
| Cost | 20104 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.165282355235896 \cdot 10^{-302}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.583668735255346:\\
\;\;\;\;\left(1 - x\right) \cdot \left(\left(e^{x}\right) \bmod \left(\mathsf{fma}\left(-0.25, x \cdot x, 1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-x}\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 25.6 |
|---|
| Cost | 6528 |
|---|
\[e^{-x}
\]
| Alternative 12 |
|---|
| Error | 37.0 |
|---|
| Cost | 64 |
|---|
\[1
\]