The solution is depending to the tool directions. Often the mechanical interface is wrong.
I don't have standard program for this.
For exemple, you can realise 2 measurements on feeler (turning arround joint 4); looking for the minimal value, turn 180° on joint 4, and report the 1/2 value with the sin and cos on X and Y value's tool.
Easier is to create a tool (tCorr) inside your tool. Put the RZ value with the joint 4 value (position 1). In this case the 1/2 value is to put directly on X or Y value's tCorr.
Other solution is to learn 2 positions on the same point. The difference give you the correction values.
Have a nice Week end...