Numerical Approximation of erfc

I have a crazy output. I already tried the N[] function. All it does is condense the inputs. Any idea of how to have a numerical output from the code?

• Please provide actual code rather than an image of code. – Daniel Lichtblau Oct 3 '18 at 17:36

Clear["Global*"]

dist = NormalDistribution[a, b];

\$Assumptions = DistributionParameterAssumptions[dist]

(* a ∈ Reals && b > 0 *)

cdf[q_] = CDF[dist, q];


If I have read your expression properly, it can be written more compactly as

expr1 = (4*(cdf[1] - cdf[0]) + 6*(cdf[2] - cdf[1]) +
8*(cdf[3] - cdf[2]) + 10*(cdf[4] - cdf[3]) +
12*(cdf[5] - cdf[4]))/(cdf[5] - cdf[0]) // FullSimplify;


And even more so as

expr2 = Total[
2 (# + 1)*(cdf[#] - cdf[# - 1]) & /@ Range[5]]/(cdf[5] - cdf[0]) //
FullSimplify

(* (2 (-6 Erf[(-5 + a)/(Sqrt[2] b)] + Erf[(-4 + a)/(Sqrt[2] b)] +
Erf[(-3 + a)/(Sqrt[2] b)] + Erf[(-2 + a)/(Sqrt[2] b)] +
Erf[(-1 + a)/(Sqrt[2] b)] + 2 Erf[a/(Sqrt[2] b)]))/(-1 +
Erf[a/(Sqrt[2] b)] + Erfc[(-5 + a)/(Sqrt[2] b)]) *)


Verifying that expr1 and expr2 are identical

expr1 === expr2

(* True *)


a = (1/2*Erfc[1/Sqrt[2]]*x);
`