Role of three-body interactions in the calculator of the total energy and the shear modulus of hexagonal metals