FDp52_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 = 5/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 = FDp52_M(x) # # FILE NAMES # # FDp52_M.mpl -- MacLeod's piecewise Chebyshev series approx # Clenshaw_M.mpl -- Clenshaw's evaluation of Chebyshev sum # # DATE # # October 17, 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,FDp52_Cheb; # Digits := 19; # # Initialize constants 2*e and 1/GAMMA(9/2) = 16/(105*sqrt(Pi)) # twoe := 5.4365636569180904e0; const := 8.5971746064420006e-2; # # Left tail region (-inf,-1) Chebyshev coefficients # c1 := array(0..11 , [ 1.9694416685896693e0 , -0.149691794643492e-1 , 0.3006955816627e-3 , -0.89462485950e-5 , 0.3298072025e-6 , -0.139239298e-7 , 0.6455885e-9 , -0.320623e-10 , 0.16783e-11 , -0.916e-13 , 0.52e-14 , -0.3e-15 ] ); # # Middle region I [-1,2) Chebyshev coefficients # c2 := array(0..21 , [ 4.2642838398655301e0 , 2.3437426884912867e0 , 0.6727119780052076e0 , 0.1148826327965569e0 , 0.109363968046758e-1 , 0.2567173957015e-3 , -0.505889983911e-4 , -0.7376215774e-6 , 0.7352998758e-6 , -0.166421736e-7 , -0.140920499e-7 , 0.9949192e-9 , 0.2991457e-9 , -0.401332e-10 , -0.63546e-11 , 0.14793e-11 , 0.1181e-12 , -0.524e-13 , -0.11e-14 , 0.18e-14 , -0.1e-15 , -0.1e-15 ] ); # # Right tail region [2,infinity) Chebyshev coefficients # c3 := array(0..61 , [ 30.2895676859802579e0 , 1.1678976642060562e0 , 0.6420591800821472e0 , 0.3461723868407417e0 , 0.1840816790781889e0 , 0.973092435354509e-1 , 0.513973292675393e-1 , 0.271709801041757e-1 , 0.143833271401165e-1 , 0.76264863952155e-2 , 0.40503695767202e-2 , 0.21543961464149e-2 , 0.11475689901777e-2 , 0.6120622369282e-3 , 0.3268340337859e-3 , 0.1747145522742e-3 , 0.934878457860e-4 , 0.500692212553e-4 , 0.268373821846e-4 , 0.143957191251e-4 , 0.77272440700e-5 , 0.41503820336e-5 , 0.22305118261e-5 , 0.11993697093e-5 , 0.6452344369e-6 , 0.3472822881e-6 , 0.1869964215e-6 , 0.1007300272e-6 , 0.542807561e-7 , 0.292607829e-7 , 0.157785918e-7 , 0.85110768e-8 , 0.45922760e-8 , 0.24785001e-8 , 0.13380255e-8 , 0.7225103e-9 , 0.3902350e-9 , 0.2108157e-9 , 0.1139122e-9 , 0.615638e-10 , 0.332781e-10 , 0.179919e-10 , 0.97288e-11 , 0.52617e-11 , 0.28461e-11 , 0.15397e-11 , 0.8331e-12 , 0.4508e-12 , 0.2440e-12 , 0.1321e-12 , 0.715e-13 , 0.387e-13 , 0.210e-13 , 0.114e-13 , 0.61e-14 , 0.33e-14 , 0.18e-14 , 0.11e-14 , 0.5e-15 , 0.3e-15 , 0.2e-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,11,t); FDp52_Cheb := ex*ChebSum; # elif x < 2 then # t := (2*x-1)/3; ChebSum := Clenshaw_M(c2,21,t); FDp52_Cheb := ChebSum; # else # xsq := x*x; FDp52_Cheb := const*x*xsq*evalf(sqrt(x)); t := (50 - xsq)/(42 + xsq); ChebSum := Clenshaw_M(c3,61,t); FDp52_Cheb := FDp52_Cheb*(1 + ChebSum/xsq); fi; # end: