Magnetic anisotropy energy of polycrystalline cubic materials