Phase transformations in the relaxor Na1/2Bi1/2TiO3 studied by means of density functional theory calculations