File:Besselk0mapT900.png

Complex map of function BesselK0.

$u+\mathrm i v= \mathrm{BesselK0}(x+\mathrm i y)$

C++ implementation of BesselK0
// Preliminary version of the C++ implementation of BesselK0 below should be saved as besselk09.cin.

// Besselk09 returns 9 correct decimal digits. //#include "besselk0o.cin" z_type besselk0o(z_type z){ z_type L=log(z); z_type t=z*z; return 0.115931515658412449 - L +t*(0.278982878914603112   -  0.25    * L  +t*(0.0252489299321626945   - 0.015625 * L   +t*(0.000846035090708222996 - 0.000434027777777777778*L  +t*(0.0000149147192992604288- 6.78168402777777778e-6 *L +t*(1.62710561048159843e-7 - 6.78168402777777778e-8 *L +t*(1.20842616500779726e-9 -  4.70950279706790123e-10*L +t*(6.50869783874735494e-12 - 2.40280754952443941e-12*L +t*(2.65978468063980854e-14 - 9.38596699032984143e-15*L +t*(8.53109013195859431e-17 - 2.89690339207711155e-17*L +t*(2.205195117791576e-19 - 7.242258480192779e-20*L +t*(4.692218659603046e-22 - 1.4963343967340453e-22*L +t*(8.362696515042043e-25 - 2.5978027721077174e-25*L +t*(1.2666460795135898e-27 - 3.8429035090350849e-28*L +t*(1.6506318753729743e-30 - 4.9016626390753634e-31*L +t*(1.8703440292223815e-33 - 5.446291821194848e-34*L +t*(1.8597493682664544e-36 - 5.318644356635594e-37*L +t*(1.6358438681148629e-39 - 4.6009034226951505e-40*L +t*(1.2819478724424317e-42 - 3.5500798014623075e-43*L +t*(9.007150297620802e-46 - 2.4585040176331769e-46*L +t*(5.706297186564038e-49 - 1.5365650110207356e-49*L +t*(3.2763418078194994e-52 - 8.710686003518909e-53*L +t*(1.7127767743327592e-55 - 4.4993212828093539e-56*L +t*(8.186857470603763e-59 - 2.1263333094562164e-59*L +t*(3.5917772099961397e-62 - 9.228877211181495e-63*L +t*(1.4514770875363463e-65 - 3.6915508844725979e-66*L +t*(5.420397042044871e-69 - 1.3652185223641265e-69*L )))) )))) )))) )))) )))) )))) )  ; }

z_type besselk0O(z_type z){ z_type t=1./z, q=sqrt(t); z_type s; s=1.25331413731550025 + t*(-0.156664267164437531 + t*( 0.0881236502799961114+ t*(-0.0917954690416626161+ t*( 0.140561811970045881 + t*(-0.284637669239342909 + t*( 0.717524124540843582 + t*(-2.16538530441790295 +  t*( 7.61268271084419007  + t*(-30.5564625476940407 + t*( 137.886037246469359  + t*(-690.997073019238491 + t*( 3807.68178778309543  + t*(-22882.7030515811024 + t*(148941.879683951997   + t*(-1.0438343401183636e6 )))) )))) )))) ))) ; return exp(-z)*q*s;}

z_type besselk09(z_type z){ DB x=Re(z)+3.8, y=Im(z); if( x*x+y*y < 13*13 ) return besselk0o(z); return besselk0O(z); }

C++ generator of curves
// File besselk09.cin above and conto.cin and ado.cin should be stored in the working directory in order to compile the C++ code below. using namespace std; typedef complex z_type; main{ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d; int M=401,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("besselk0map.eps","w");ado(o,162,162); fprintf(o,"81 81 translate\n 10 10 scale\n"); DO(n,200)Y[n]=-8.+.04*n; Y[200]=-.006; Y[201]= .006; for(n=202;n-43. && p<43.   &&     q>-43. && q<43.        ) {g[m*N1+n]=p; f[m*N1+n]=q; }                      }} //fprintf(o,"-3.8 0 13 0 360 arc C 1 .8 1 RGB .5 W S\n"); // #include "plodi.cin" // #include "plofu.cin" fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=1.5;q=1.2; 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,".01 W 0 .6 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,".01 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,".01 W 0 0 .9 RGB S\n"); for(m=1;m<9;m++) conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p); fprintf(o,".03 W .9 0 0 RGB S\n"); for(m=1;m<9;m++) conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".03 W 0 0 .9 RGB S\n"); conto(o,f,w,v,X,Y,M,N, (0. ),-p,p); fprintf(o,".03 W .6 0 .6 RGB S\n"); for(m=-9;m<10;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".03 W 0 0 0 RGB S\n"); M(0,0)L(-8,0) fprintf(o,"0 setlinecap 1 1 1 RGB .02 W S\n"); DO(m,32){ M(-.25*(m+.25),0)L(-.25*(m+.75),0) fprintf(o,"0 0 0 RGB .035 W S\n"); } fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o); system("epstopdf besselk0map.eps"); system(   "open besselk0map.pdf"); getchar; system("killall Preview");//for mac }
 * 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 "conto.cin"
 * 5) include "besselk09.cin"

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

\documentclass[12pt]{article} % \usepackage{geometry} % \usepackage{graphicx} % \usepackage{rotating} % \usepackage{hyperref} % \paperwidth 170pt % \paperheight 169pt % \textwidth 180pt % \textheight 180pt % \topmargin -108pt % \oddsidemargin -72pt % \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}} % \begin{picture}(166,166) % \put(8,5){\includegraphics{besselk0map.pdf}} % % \put( 3,163){\sx{.8}{$y$}} % \put( 3,143){\sx{.8}{$6$}} % \put( 3,123){\sx{.8}{$4$}} % \put( 3,103){\sx{.8}{$2$}} % \put( 3,83){\sx{.8}{$0$}} % \put(-3,63){\sx{.8}{$-2$}} % \put(-3,43){\sx{.8}{$-4$}} % \put(-3,23){\sx{.8}{$-6$}} % \put(23,-1){\sx{.75}{$-6$}} % \put(43,-1){\sx{.75}{$-4$}} % \put(63,-1){\sx{.75}{$-2$}} % \put(87.4,-1){\sx{.75}{$0$}} % \put(107.4,-1){\sx{.75}{$2$}} % \put(127.4,-1){\sx{.75}{$4$}} % \put(147.4,-1){\sx{.75}{$6$}} % \put(164.6,-.5){\sx{.8}{$x$}} % \put(12,83.5){\bf cut} % \put(142,157.8){$u\!=\!0$} % \put(142,143.0){$v\!=\!0$} % \put(142,127.7){$u\!=\!0$} % \put(142,113.0){$v\!=\!0$} % \put(142,98.0){$u\!=\!0$} % \put(142,83.5){$v\!=\!0$} %central % \put(142,68.0){$u\!=\!0$} % \put(142,54.0){$v\!=\!0$} % \put(142,39.0){$u\!=\!0$} % \put(142,24.0){$v\!=\!0$} % \put(142,9.0){$u\!=\!0$} % % % \put(102.6,93){\sx{.6}{$v\!=\!-0.2$}} % \put(104,87){\sx{.6}{$u\!=\!0.2$}} % \put(103,77){\sx{.6}{$v\!=\!0.2$}} % \put(101.6,61){\sx{.6}{$u\!=\!-0.2$}} % \put(99.4,48){\sx{.6}{$v\!=\!-0.2$}} % \end{picture} % % \end{document} %