Effective hamiltonians with relativistic corrections: The Foldy-Wouthuysen transformation versus the direct Pauli reduction