I'm trying to learn by myself some Lagrangian mechanics, and I found on Wikipedia this relativistic Lagrangian
$$L=\frac{1}{2}mu_{\alpha}u^{\alpha}, \tag{1}$$
where $$u^\alpha=\frac{dx^{\alpha}}{d\tau}\tag{2}$$ is the four-velocity and I don't know if $m>0$ is the rest or relativistic mass. And here is my problem. I used these Euler-Lagrange equations
$$\frac{\partial L}{\partial x^{\beta}}-\frac{{\rm d}}{{\rm d}\tau}\left(\frac{\partial L}{\partial u^{\beta}}\right)=0, \tag{3}$$
which are in the article and I finish with this
$$\frac{{\rm d}}{{\rm d}\tau}\left(mu_{\beta}\right)=0.\tag{4}$$
What I think it's the conservation of four-momentum, if $m$ is the rest mass. Right? But a trouble came when I calculated the energy with this formula
$$E=\frac{\partial L}{\partial \dot{r}}\cdot\dot{r}-L\tag{5}$$
with $r$ the position vector. I did this, I don't know if it's correct
$$E=\frac{\partial L}{\partial u^{\beta}}u^{\beta}-L\tag{6}$$
$$E=mu_{\beta}u^{\beta}-\frac{1}{2}mu_{\alpha}u^{\alpha}\tag{7}$$
Now because $$u_{\beta}u^{\beta}=c^{2}\tag{8}$$ I get
$$E=mc^{2}-\frac{1}{2}mc^{2}=\frac{1}{2}mc^{2}.\tag{9}$$
This is not the relativistic energy of the particle of course, there is a missed gamma factor which can appear if $m$ is the relativistic mass. But it isn't still the energy because of the $\frac{1}{2}$ and confuse me of what is $m$. Is something there correct? What am I doing wrong?