A method for obtaining a magnetoresistive element for a two-dimensional magnetic field sensor, the magnetoresistive element comprising: a ferromagnetic reference layer having a fixed reference magnetization , a ferromagnetic sense layer having a sense magnetization that can be freely oriented relative to the reference magnetization in the presence of an external magnetic field, and a tunnel barrier layer between the reference and sense ferromagnetic layers ; the reference layer comprising a reference coupling layer between a reference pinned layer and a reference coupled layer ; the reference coupled layer comprising a first coupled sublayer in contact with the reference coupling layer , a second coupled sublayer in contact with the first coupled sublayer , a third coupled sublayer and an insert layer between the second and third coupled sublayers , the insert layer providing a ferromagnetic exchange coupling between the second and third coupled sublayers ; and the insert layer comprising Ta and having a thickness of 0.2 nm; wherein the method comprises: forming the ferromagnetic reference layer , the tunnel barrier layer , and the ferromagnetic sense layer ; wherein the reference pinned layer comprises a CoFe alloy and has a thickness of 2 nm, the tunnel barrier layer comprises oxidized Mg, the first coupled sublayer is made of a CoFe alloy and has a thickness of 0.5 nm, the second coupled sublayer is made of a CoFeB alloy and has a thickness of 0.75 nm, and the third coupled sublayer is made of a CoFeB alloy and has a thicknesses between 0.45 nm and 0.95 nm; and thermally treating the magnetoresistive element at 310°C for 90 minutes under an applied magnetic field of about 1T. a ferromagnetic reference layer having a fixed reference magnetization , a ferromagnetic sense layer having a sense magnetization that can be freely oriented relative to the reference magnetization in the presence of an external magnetic field, and a tunnel barrier layer between the reference and sense ferromagnetic layers ; the reference layer comprising a reference coupling layer between a reference pinned layer and a reference coupled layer ; the reference coupled layer comprising a first coupled sublayer in contact with the reference coupling layer , a second coupled sublayer in contact with the first coupled sublayer , a third coupled sublayer and an insert layer between the second and third coupled sublayers , the insert layer providing a ferromagnetic exchange coupling between the second and third coupled sublayers ; and the insert layer comprising Ta and having a thickness of 0.2 nm; wherein the method comprises: forming the ferromagnetic reference layer , the tunnel barrier layer , and the ferromagnetic sense layer ; wherein the reference pinned layer comprises a CoFe alloy and has a thickness of 2 nm, the tunnel barrier layer comprises oxidized Mg, the first coupled sublayer is made of a CoFe alloy and has a thickness of 0.5 nm, the second coupled sublayer is made of a CoFeB alloy and has a thickness of 0.75 nm, and the third coupled sublayer is made of a CoFeB alloy and has a thicknesses between 0.45 nm and 0.95 nm; and thermally treating the magnetoresistive element at 310°C for 90 minutes under an applied magnetic field of about 1T. forming the ferromagnetic reference layer , the tunnel barrier layer , and the ferromagnetic sense layer ; wherein the reference pinned layer comprises a CoFe alloy and has a thickness of 2 nm, the tunnel barrier layer comprises oxidized Mg, the first coupled sublayer is made of a CoFe alloy and has a thickness of 0.5 nm, the second coupled sublayer is made of a CoFeB alloy and has a thickness of 0.75 nm, and the third coupled sublayer is made of a CoFeB alloy and has a thicknesses between 0.45 nm and 0.95 nm; and thermally treating the magnetoresistive element at 310°C for 90 minutes under an applied magnetic field of about 1T. <EOS>