In general, use the ICDF code!
Why would it be more accurate? Because it can be more intelligent, using a more accurate approximation in the tails. For example, using erfinv as you did does something that is dangerous in the tails.
x1
x1 =
-5.99671052251153
x2
x2 =
-5.9967105158771
vpa((sig*sqrt(2))*erfinv(2*sym(p)-1) + mu)
ans =
-5.9967105225115303073434653073673
So x2 is your computation. Then I computed a symbolic version of your computation. As you can see, it is now the same as x1.
The point is, icdf gave you a result that is correct to the last digit printed, whereas the double precision erfinv code failed.
Best Answer