Accurate and efficient determination of higher roots in diagonalization of large matrices based in function restricted optimization algorithms