This maybe a bit of a silly question of my part, but I am trying to rewrite the Reflectivity, $R$ as a function of the complex dielectric function $\epsilon = \epsilon_r + i\epsilon_i$. Starting from the generic reflectivity equation, assuming a vacuum interface ($n_2$ =1) \begin{equation} R = \frac{(1-n)^2 + k^2}{(1+n)^2 + k^2} \end{equation} And then using that $n + ik = \sqrt{\epsilon}$ and the algebraic form for the square root of a complex number, we obtain: \begin{equation} n = \frac{1}{\sqrt{2}}\sqrt{\sqrt{\epsilon_r^2 + \epsilon_i^2} + \epsilon_r} \end{equation} \begin{equation} k = \frac{1}{\sqrt{2}}\sqrt{\sqrt{\epsilon_r^2 + \epsilon_i^2} - \epsilon_r} \end{equation} However, I now have an issue in that I obtaining negative R values when one plots $R$ as a function of $\epsilon_r$ and $\epsilon_i$. I have plotted the resulting equation below. Is there something wrong with the approach I have done here? Is a negative reflectivity physically meaningful or is it indicating that equation can only be used for certain values of $\epsilon_r$ and $\epsilon_i$?
UPDATE: This was a calculation error on my side, by rewriting my code. I believe that accidentally put a minus sign in the numerator, leading to negative values. This new graph is obtained: 
