# erfi(x) is the imaginary error function ; # erfi(x_):= If(x==0, 0, If(x==inf, inf, If(iscomplex(x) and re(x)==0, i*erf(im(x)), If(isnumber(x), nint(exp(t^2),t,0,x)*1.12838) ))); # erfi(n,x) is the nth derivative of the imaginary error function; erfi(i*x_):= i*erf(x); erfi(0):=0; erfi(inf):=inf;