Artificial intelligent assistant

On the justification behind a big O manipulation (quick question). If $n \in N$ and $0<z \in R $, what is the rigorous justification behind the following big O manipulation? \begin{align} \left(1+\frac{(\log z)^2}{2n}+O\left(\frac1{n^{3/2}} \right)\right)^n &=e^{(\log z)^2/2}+O\left(\frac1{n^{1/2}} \right) \end{align}

For simplicity I set $y = (\log z)^2/2$, which is a real constant. Pass to logarithm: $$ n \log \left (1+\frac{y}{n}+O\left ( \frac{1}{n^{3/2}} \right ) \right ) = n\left [\frac{y}{n} + O\left ( \frac{1}{n^{3/2}} \right ) \right ] = y + O\left ( \frac{1}{n^{1/2}} \right ). $$

In the first equality I throwed away a term $O(1/n^2)$ within the parenthesis. Now exponentiate back! $$ e^y \cdot e^{O(1/n^{1/2})} = e^y \cdot \left [1 + O\left ( \frac{1}{n^{1/2}} \right ) \right ] = e^y + O\left ( \frac{1}{n^{1/2}} \right ). $$

In the first equality I throwed away a term $O(1/n)$ within the parenthesis.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6c565ab2dfe54a5e3539f4bfbfe39204