File:AfacmapT800.png

Complex map of ArcFactorial

fac.cin
// The code below should be stored as fac.cin

z_type fracti(z_type z){ z_type s; int n; DB a[17]= {0.0833333333333333333, 0.0333333333333333333, .252380952380952381, .525606469002695418,  1.01152306812684171,   1.51747364915328740,   2.26948897420495996, 3.00991738325939817,  4.02688719234390123,   5.00276808075403005,   6.28391137081578218, 7.49591912238403393,  9.04066023436772670,  10.4893036545094823,   12.2971936103862059, 13.9828769539924302,  16.0535514167049355 }; s=a[16]/(z+19./(z+25./(z)));  for(n=15;n>=0;n--) s=a[n]/(z+s); return s + log(2.*M_PI)/2. - z + (z+.5)*log(z); } // logfactorial for large values of argument except vicinity of negative part of real axis)

z_type infac0(z_type z){ z_type s; int n; DB c[28]={ 1., 0.57721566490153286061,       -0.65587807152025388108, -0.042002635034095235529,        0.16653861138229148950, -0.042197734555544336748,       -0.0096219715278769735621,  0.0072189432466630995424,      -0.0011651675918590651121, -0.00021524167411495097282,      0.00012805028238811618615, -0.000020134854780788238656,    -0.0000012504934821426706573,  0.0000011330272319816958824,   -2.0563384169776071035e-7, 6.1160951044814158179e-9,      5.0020076444692229301e-9, -1.1812745704870201446e-9,      1.0434267116911005105e-10, 7.7822634399050712540e-12,    -3.6968056186422057082e-12, 5.1003702874544759790e-13,    -2.0583260535665067832e-14, -5.3481225394230179824e-15,     1.2267786282382607902e-15, -1.1812593016974587695e-16,     1.1866922547516003326e-18, 1.4123806553180317816e-18}; s=c[27]*z; for(n=26;n>0;n--) {s+=c[n]; s*=z;} s+=c[0]; return s;}

z_type fac0(z_type z){ return 1./infac0(z);}

z_type expaun(z_type z) {int n,m; DB x,y; x=Re(z);if(x<-.5) return expaun(z+1.)-log(z+1.); if(x>.6) return expaun(z-1.)+log(z); y=Im(z); if(fabs(y)>1.4)return expaun(z/2.)+expaun(z/2.-.5)+z*log(2.)-log(sqrt(M_PI)); return -log(infac0(z)); }

z_type lof(z_type z){DB x,y; x=Re(z); y=Im(z); if(fabs(y)>5. ) return fracti(z); if(x>0 && x*x+y*y>25.) return fracti(z); return expaun(z); } // lof(z) returns 16 digits of complex logfactorial.

z_type infac1(z_type z){return infac0(z/2.)*infac0((z-1.)/2.)*sqrt(M_PI)/exp(log(2.)*z);} z_type infac2(z_type z){return infac1(z/2.)*infac1((z-1.)/2.)*sqrt(M_PI)/exp(log(2.)*z);} z_type infac3(z_type z){return infac2(z/2.)*infac2((z-1.)/2.)*sqrt(M_PI)/exp(log(2.)*z);} z_type inhalf(z_type z){DB x=Re(z); DB y=Im(z); DB r=x*x+y*y; if(r<2.) return infac0(z); if(r<5.) return infac1(z); return infac2(z); }

z_type infacmi(z_type z){ if(Re(z)> 1.) return infacmi(z-1.)/z;    return inhalf(z);} z_type infaclu(z_type z){ if(Re(z)<-.5) return infaclu(z+1.)*(z+1.);return inhalf(z);}

z_type infac(z_type z){DB x=Re(z),y=Im(z),t=x*x+y*y; if(t<1.)return infac0(z); if( fabs(y)> 5. || (x>0 && t>25) )             return exp(-fracti(z)); if( x>0 ) return infacmi(z); return infaclu(z);}

z_type fac(z_type z){ DB x=Re(z),y=Im(z),t=x*x+y*y; if(t<2.)return 1./infac0(z); if( (x>0. && t>25.) || fabs(y)>5.)        return exp(fracti(z)); if(x>0) return 1./infacmi(z); return 1./infaclu(z);}

afacc.cin
// The code below should be stored as afacc.cin

z_type afacb(z_type z){ DB z0=0.461632144968362341262659542325721328468196204; DB F0=-0.12148629053584960809551455717769158215135617313; DB c2=.483836122723810585213722380854825370205628608; DB p=0.2090973242496979633924701135209125815611056; DB q=0.0565790271828431799463572817754001404669620; DB A=0.0008685913050832152753870514845664790993724; DB B=0.0002046727298252365296379380008904113017495; z_type t=(log(z)-F0)/c2;  z_type v=sqrt(t); z_type u=v*(1.+v*(p+A*t)) /(1.+v*(q+B*t)) + z0; return u;} z_type afacc(z_type z){ z_type a,c,d;  a=afacb(z); d=facp(a); c=z-fac(a); a+=c/d; if(abs(c)<1.e-12) return a; d=facp(a); c=z-fac(a); a+=c/d; if(abs(c)<1.e-12) return a; d=facp(a); c=z-fac(a); a+=c/d; if(abs(c)<1.e-12) return a; d=facp(a); c=z-fac(a); a+=c/d; if(abs(c)<1.e-12) return a; d=facp(a); c=z-fac(a); a+=c/d; return a; }

afacmap.cin
Files fac.cin, afacc.cin above and ado.cin and conto.cin should be loaded in the working directory for compillation of the C++ code below:

using namespace std; typedef complex z_type; //#include "sinc.cin" //#include "superfac.cin"
 * 1) include 
 * 2) include 
 * 3) include 
 * 4) define DB double
 * 5) define DO(x,y) for(x=0;x<y;x++)
 * 1) include
 * 1) define Re(x) x.real
 * 2) define Im(x) x.imag
 * 3) define I z_type(0.,1.)
 * 4) include "fac.cin"
 * 1) include "facp.cin"
 * 2) include "afacc.cin"
 * 1) include "conto.cin"

main{ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d; int M=400,M1=M+1; int N=401,N1=N+1; DB X[M1],Y[N1], g[M1*N1],f[M1*N1], w[M1*N1]; // w is working array. char v[M1*N1]; // v is working array // FILE *o;o=fopen("fig2b.eps","w");ado(o,402,402); FILE *o;o=fopen("afacmap.eps","w");ado(o,402,402); fprintf(o,"201 201 translate\n 20 20 scale\n"); DO(m,M1) X[m]=-8.+.04*(m); DO(n,200)Y[n]=-8.+.04*n; Y[200]=-.01; Y[201]= .01; for(n=202;n-6.9 && p<6.9 && //      (fabs(y)>.034 ||x>-.9 ||fabs(x-int(x))>1.e-3) &&           q>-6.9 && q<6.9 //&& fabs(q)> 1.e-19        ) {g[m*N1+n]=p;f[m*N1+n]=q;} }} //fprintf(o,"1 setlinejoin 2 setlinecap\n"); p=1.8;q=.7; fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=.4;q=.4; for(m=-4;m<4;m++)for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N,(m+.1*n),-q, q); fprintf(o,".025 W 0 .6 0 RGB S\n"); for(m=0;m<2;m++) for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N,-(m+.1*n),-q, q); fprintf(o,".025 W .9 0 0 RGB S\n"); for(m=0;m<4;m++) for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (m+.1*n),-q, q); fprintf(o,".025 W 0 0 .9 RGB S\n"); for(m=1;m<5;m++) conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p); fprintf(o,".07 W .9 0 0 RGB S\n"); for(m=1;m<5;m++) conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".07 W 0 0 .9 RGB S\n"); conto(o,f,w,v,X,Y,M,N, (0. ),-p,p); fprintf(o,".07 W .6 0 .6 RGB S\n"); for(m=-4;m<7;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".07 W 0 0 0 RGB S\n"); //#include"plofu.cin" x=0.8856031944; M(x,-8)L(x,8) fprintf(o,"0 setlinejoin 0 setlinecap 0.004 W 0 0 0 RGB S\n"); M(x,0)L(-8.1,0) fprintf(o,"                  .05 W  1 1 1 RGB S\n"); DO(m,23){ M(x-.4*m,0)L(x-.4*(m+.5),0);} fprintf(o,".09 W .3 .3 0 RGB S\n"); //M(x,0)L(-8.1,0) fprintf(o,"[.19 .21]0 setdash .05 W 0 0 0 RGB S\n"); // May it be, that, some printers do not interpret well the dashing ? fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o); system("epstopdf afacmap.eps"); system(   "open afacmap.pdf"); //for LINUX //    getchar; system("killall Preview");//for mac }

Latex generator of labels
% File afacmap.pdf should be generated with the code above in order to compile the Latex document below:

% % \documentclass[12pt]{article} % \usepackage{geometry} % \usepackage{graphicx} % \usepackage{rotating} % \usepackage{hyperref} % \paperwidth 339px % \paperheight 336px % \textwidth 165mm % \textheight 240mm % \topmargin -96pt % \oddsidemargin -76pt % \parindent 0pt % \begin {document} % \newcommand \sx {\scalebox} % \newcommand \rme 	 % \newcommand \rmi 	%imaginary unity is always roman font % \newcommand \ds {\displaystyle} % \newcommand \bN {\mathbb{N}} % \newcommand \bC {\mathbb{C}} % \newcommand \bR {\mathbb{R}} % \newcommand \cO {\mathcal{O}} % \newcommand \cF {\mathcal{F}} % \newcommand \rot {\begin{rotate}} % \newcommand \ero {\end{rotate}} % \newcommand \nS {\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!} % \newcommand \pS {{~}~{~}} % \newcommand \fac {\mathrm{Factorial}} % \newcommand \ax { % \put( 10,342){\sx{1.4}{$y$}} % \put( 10,307){\sx{1.3}{$6$}} % \put( 10,267){\sx{1.3}{$4$}} % \put( 10,227){\sx{1.3}{$2$}} % \put( 10,187){\sx{1.3}{$0$}} % \put( 0,147){\sx{1.3}{$-2$}} % \put( 0,107){\sx{1.3}{$-4$}} % \put( 0, 67){\sx{1.3}{$-6$}} % \put( 0, 27){\sx{1.3}{$-8$}} % \put( 50, 18){\sx{1.3}{$-6$}} % \put( 90, 18){\sx{1.3}{$-4$}} % \put(130, 18){\sx{1.3}{$-2$}} % \put(178, 18){\sx{1.3}{$0$}} % \put(218, 18){\sx{1.3}{$2$}} % \put(258, 18){\sx{1.3}{$4$}} % \put(298, 18){\sx{1.3}{$6$}} % \put(334, 19){\sx{1.4}{$x$}} % } % \begin{picture}(340,340) \ax % \put(-20,-10){\includegraphics{afacmap}} % \put(158,348){\rot{-73}\sx{1.5}{$q\!=\!1.2$}\ero} % \put(102,346){\rot{-51}\sx{1.5}{$q\!=\!1.4$}\ero} % \put( 61,313){\rot{-34}\sx{1.5}{$q\!=\!1.6$}\ero} % \put( 38,268){\rot{-16}\sx{1.5}{$q\!=\!1.8$}\ero} % \put( 32,236){\rot{ -2}\sx{1.5}{$q\!=\!2$}\ero} % \put( 32,188){\sx{1.8}{\bf cut}} % \put( 33,152){\sx{1.5}{$q\!=\!-2$}} % \put( 36,106){\rot{15}\sx{1.5}{$q\!=\!-1.8$}\ero} % \put( 64, 60){\rot{35}\sx{1.5}{$q\!=\!-1.6$}\ero} % \put(112, 33){\rot{53}\sx{1.5}{$q\!=\!-1.4$}\ero} % \put(166, 27){\rot{74}\sx{1.5}{$q\!=\!-1.2$}\ero} % % % \put(225,308){\rot{82}\sx{1.5}{$q\!=\!1$}\ero} % \put(219, 83){\rot{-87}\sx{1.5}{$q\!=\!-1$}\ero} % \put(244, 89){\rot{-68}\sx{1.5}{$q\!=\!-0.8$}\ero} % \put(253,293){\rot{62}\sx{1.5}{$q\!=\!0.8$}\ero} % \put(280,276){\rot{45}\sx{1.5}{$q\!=\!0.6$}\ero} % \put(300,250){\rot{30}\sx{1.5}{$q\!=\!0.4$}\ero} % \put(298,226){\rot{15}\sx{1.5}{$q\!=\!0.2$}\ero} % \put(304,187){\sx{1.6}{$q$=0}} % %\put(300,162){\rot{-15}\sx{1.5}{$q\!=\!-0.2$}\ero} % \put(264,132){\rot{54}\sx{1.5}{$p$=2.8}\ero} % \put(280,110){\rot{50}\sx{1.5}{$p$=3}\ero} % \put(290, 70){\rot{44}\sx{1.5}{$p$=3.2}\ero} % \put(300, 42){\rot{39}\sx{1.5}{$p$=3.4}\ero} % \end{picture} % \end{document} % %