Abelfac.cin

// abelfac.cin is routine for evaluation of AbelFactorial of complex argument.

z_type arcsuperfac0(z_type z){ int n; z_type s, c, e; DB k=0.61278745233070836381366079016859252; DB U[19]={1.,                         -0.798731835172434541585621072345730147, 0.69806411355936704552792746483306691, -0.6339640557572814865638000833478131,  0.5884152357911398848274232132172143,  -0.5538887519936519511632593654732843,   0.526547902598592454703287733600892,   -0.504191460428021561516069870422848,    0.48545298002933922263549078734881,    -0.46943468090947139273094056497701, 0.4555204862393622788179080677150,     -0.4432726222110411295132308010077,      0.4323708863150174727399798603985,     -0.4225752531177612936293974175008,      0.413701949171132722406449918702,      -0.40560764595293667778491699902,  0.39817872478532299454624349817,       -0.391323,      0.384}; //     z-=2.; s=U[15]*z; for(n=14;n>=0;n--){ s+=U[n]; s*=z;} z-=2.; s=U[18]*z; for(n=17;n>=0;n--){ s+=U[n]; s*=z;} return log(s)/k;}

z_type arcsuperfac(z_type z){ if(abs(z-2.)<.12) return arcsuperfac0(z); return arcsuperfac(afacc(z))+1.;} // As in the Paper

z_type abelfac(z_type z){ if(abs(z-2.)<.12) return arcsuperfac0(z)+0.91938596545217788; return abelfac(afacc(z))+1.;}

// Sorry it is not optimized; this function could be implemented even faster.