4f and 5d magnetism in samarium