# Is there an easy way to let mathematica print out every Erfc and InverseErfc as F and F^{-1}

Mathematica uses complementary error function and its inverse as functions for example when integral of a Gaussian is taken. Therefore, all output expressions of Mathematica involve Erfc and InverseErfc, if needed.

My question is: If there is an easy way to manipulate mathematica so that it outputs CDF of standard normal Gaussian distribution for Erfc and inverse CDF of standard Gaussian for InverseErfc?

I used the following and it should be working BUT I am not able to verify this!

Unprotect[Erfc];
Unprotect[InverseErfc];

Erfc[x_] := 2*(1 - f[x*Sqrt])
InverseErfc[x_] := -ff[x/2]/Sqrt;


and then I use

FullSimplify[1/2 (1 - p0) Erfc[(-((Sqrt[n] (μ0 - μ1))/σ) +
Sqrt InverseErfc[
2 (1 + 1/
2 (-2 +
Erfc[(Sqrt n (μ0 - μ1)^2 -
Sqrt σ^2 Log[(-1 + p0)^2/p0^2])/(
4 Sqrt[n] (μ0 - μ1) σ)]))])/Sqrt] + 1/2 p0 (2 -
Erfc[(Sqrt n (μ0 - μ1)^2 -
Sqrt σ^2 Log[(-1 + p0)^2/p0^2])/(
4 Sqrt[n] (μ0 - μ1) σ)])]


and I only guess that the output is correct. But I connot confirm it. When I define later on

f[x_] := CDF[NormalDistribution[0, 1], x];
ff[x_] := InverseCDF[NormalDistribution[0, 1], x];


I got problems. Is the way I follow sound? How can I justify that Mathematica indeed fullsimplified correctly, I mean in terms of $f$ and $ff$.

• Since CDF[NormalDistribution[]] includes Erfc, you're now defining f in terms of something which itself is now defined in terms of f. This can only lead to problems. Maybe use a replacement rule like {Erfc -> (2 f[-Sqrt #] &)}? – 2012rcampion Mar 10 '15 at 1:34
• I would like to point you to a similar question I wrote about a different function Dot. I hope it will help: mathematica.stackexchange.com/questions/63147/… – QuantumDot Jun 9 '15 at 9:25