FDm12_M := proc(x) # # --------------------------------------------------------------- # # PURPOSE # # This Maple 6 procedure Computes the Fermi-Dirac integral # # Fj(x) = 1/GAMMMA(j+1)*int(t^j/(exp(t-x)+1),t=0..infinity) # # of order j = -1/2, correct to at least 15 significant decimal # digits of accuracy using MacLeod's piecewise Chebyshev series # approximation scheme. (See reference below.) # # The magnitude of the relative error is at most 0.4x10^(-15) # on the x domain (-infinity,infinity). # # USAGE # # y = FDm12_M(x) # # FILE NAMES # # FDm12_M.mpl -- MacLeod's piecewise Chebyshev series approx # Clenshaw_M.mpl -- Clenshaw's evaluation of Chebyshev sum # # DATE # # October 12, 2000 # # PROGRAMMER # # Dr. F.G. Lether # Dept. Math. # Univ. Georgia # Athens, GA. 30602 USA # # email : fglether@math.uga.edu # # REFERENCE # # MacLeod, Allan.J.(1998), Algorithm 778: Fermi-Dirac Functions # of Order -1/2,1/2,3/2,5/2, Trans. Math. Soft. (TOMS) 24,1-12 # # --------------------------------------------------------------- # local twoe,const,c1,c2,c3,ex,t,xsq,ChebSum,FDm12_Cheb; # Digits := 19; # # Initialize constants 2*e and 1/GAMMA(3/2) = 2/sqrt(Pi) # twoe := 5.4365636569180904; const := 1.1283791670955126; # # Left tail region (-inf,-1) Chebyshev coefficients # c1 := array(0..14 , [ 1.7863596385102264e0 , -0.999372007632333e-1 , 0.64144652216054e-2 , -0.4356415371345e-3 , 0.305216700310e-4 , -0.21810648110e-5 , 0.1580050781e-6 , -0.115620570e-7 , 0.8525860e-9 , -0.632529e-10 , 0.47159e-11 , -0.3530e-12 , 0.265e-13 , -0.20e-14 , 0.2e-15 ] ); # # Middle region I [-1,2) Chebyshev coefficients # c2 := array(0..23 , [ 1.6877111526052352e0 , 0.5978360226336983e0 , 0.357226004541669e-1 , -0.132144786506426e-1 , -0.4040134207447e-3 , 0.5330011846887e-3 , -0.148923504863e-4 , -0.218863822916e-4 , 0.19652084277e-5 , 0.8565830466e-6 , -0.1407723133e-6 , -0.305175803e-7 , 0.83524532e-8 , 0.9025750e-9 , -0.4455471e-9 , -0.148342e-10 , 0.219266e-10 , -0.6579e-12 , -0.10009e-11 , 0.936e-13 , 0.420e-13 , -0.71e-14 , -0.16e-14 , 0.4e-15 ] ); # # Right tail region [2,infinity) Chebyshev coefficients # c3 := array(0..58 , [ 0.8707195029590563e0 , 0.59833110231733e-2 , -0.432670470895746e-1 , -0.393083681608590e-1 , -0.191482688045932e-1 , -0.65582880980158e-2 , -0.22276691516312e-2 , -0.8466786936178e-3 , -0.2807459489219e-3 , -0.955575024348e-4 , -0.362367662803e-4 , -0.109158468869e-4 , -0.39356701000e-5 , -0.13108192725e-5 , -0.2468816388e-6 , -0.1048380311e-6 , 0.236181487e-7 , 0.227145359e-7 , 0.145775174e-7 , 0.153926767e-7 , 0.56924772e-8 , 0.50623068e-8 , 0.23426075e-8 , 0.12652275e-8 , 0.8927773e-9 , 0.2994501e-9 , 0.2822785e-9 , 0.910685e-10 , 0.696285e-10 , 0.366225e-10 , 0.124351e-10 , 0.145019e-10 , 0.16645e-11 , 0.45856e-11 , 0.6092e-12 , 0.9331e-12 , 0.5238e-12 , -0.56e-14 , 0.3170e-12 , -0.926e-13 , 0.1265e-12 , -0.327e-13 , 0.276e-13 , 0.33e-14 , -0.42e-14 , 0.101e-13 , -0.73e-14 , 0.64e-14 , -0.37e-14 , 0.23e-14 , -0.9e-15 , 0.2e-15 , 0.2e-15 , -0.3e-15 , 0.4e-15 , -0.3e-15 , 0.2e-15 , -0.1e-15 , 0.1e-15 ] ); # # Compute MacLeod approximation depending on x in # (-infinity,-1), [1,2) or [2,infinity) # if x < -1 then # ex := evalf(exp(x)); t := twoe*ex - 1; ChebSum := Clenshaw_M(c1,14,t); FDm12_Cheb := ex*ChebSum; # elif x < 2 then # t := (2*x-1)/3; ChebSum := Clenshaw_M(c2,23,t); FDm12_Cheb := ChebSum; # else # FDm12_Cheb := const*evalf(sqrt(x)); xsq := x*x; t := (50 - xsq)/(42 + xsq); ChebSum := Clenshaw_M(c3,58,t); FDm12_Cheb := FDm12_Cheb*(1 - ChebSum/xsq); fi; # end: