  We establish improved uniform error bounds for the time-splitting methods for
the long-time dynamics of the Schr\"odinger equation with small potential and
the nonlinear Schr\"odinger equation (NLSE) with weak nonlinearity. For the
Schr\"odinger equation with small potential characterized by a dimensionless
parameter $\varepsilon \in (0, 1]$ representing the amplitude of the potential,
we employ the unitary flow property of the (second-order) time-splitting
Fourier pseudospectral (TSFP) method in $L^2$-norm to prove a uniform error
bound at $C(T)(h^m +\tau^2)$ up to the long time $T_\varepsilon= T/\varepsilon$
for any $T>0$ and uniformly for $0<\varepsilon\le1$, while $h$ is the mesh
size, $\tau$ is the time step, $m \ge 2$ depends on the regularity of the exact
solution, and $C(T) =C_0+C_1T$ grows at most linearly with respect to $T$ with
$C_0$ and $C_1$ two positive constants independent of $T$, $\varepsilon$, $h$
and $\tau$. Then by introducing a new technique of {\sl regularity compensation
oscillation} (RCO) in which the high frequency modes are controlled by
regularity and the low frequency modes are analyzed by phase cancellation and
energy method, an improved uniform error bound at $O(h^{m-1} + \varepsilon
\tau^2)$ is established in $H^1$-norm for the long-time dynamics up to the time
at $O(1/\varepsilon)$ of the Schr\"odinger equation with
$O(\varepsilon)$-potential with $m \geq 3$, which is uniformly for
$\varepsilon\in(0,1]$. Moreover, the RCO technique is extended to prove an
improved uniform error bound at $O(h^{m-1} + \varepsilon^2\tau^2)$ in
$H^1$-norm for the long-time dynamics up to the time at $O(1/\varepsilon^2)$ of
the cubic NLSE with $O(\varepsilon^2)$-nonlinearity strength, uniformly for
$\varepsilon \in (0, 1]$. Extensions to the first-order and fourth-order
time-splitting methods are discussed.
