# erf(x) is the error function; # erf(n,x) is the generalized error function; erf(n_,x_):=If(isnumber(n) and isnumber(x), gamma(n)*(gamma(1/n)-gamma(1/n,x^n))/sqrt(pi)); erf(0,x_) := x/sqrt(pi)/exp(1); erf(1,x_) := 1/sqrt(pi)-exp(-x)/sqrt(pi); erf(2,x_) := erf(x);