Arqnem.cin

From TORI
Jump to: navigation, search

// Arqnem.cin is C++ implementation of function ArqNem, which is inverse function of the Nemtsov function

// arcnem(z) evaluates \(\mathrm{ArcNem}_Q(z)\), while parameter \(Q\) should be stored as global variable, together with other parameters evaluated by nembran.cin.



// DB Q=1.; //but may have also other value
/*
z_type nem(z_type z){ return z*(1.+z*z*(1.+z*Q)); }
z_type nem1(z_type z){ return 1.+z*z*(3.+z*(4.*Q)); } // WARNING: Q is global!

#include"nembran.cin"
z_type NemZo=nembra(Q);
z_type ANemZo=nem(NemZo);
DB tr=Re(ANemZo);
DB ti=Im(ANemZo);
*/

z_type arnemU(z_type z){ DB q=Q; DB q2=q*q; DB q3=q2*q;
z_type a=q-z; z_type b=1.+4.*q*z; z_type r=81.*(a*a)+12.*(b*b*b);
z_type R=-I*sqrt(-r);
z_type s=27.*a + 3.*R; z_type S=pow(s,1./3.);
z_type B=(0.26456684199469993*S)/q - (1.2599210498948732*b)/(q*S);
z_type h=0.25/q2 + B;
z_type H=I*sqrt(-h);
z_type g=0.5/q2 - B + (.25+2.*q2)/(q3*H);
z_type G=I*sqrt(-g);
return - 0.25/q - 0.5*H + 0.5*G ;}

z_type arnemD(z_type z){ DB q=Q; DB q2=q*q; DB q3=q2*q;
z_type a=q-z; z_type b=1.+4.*q*z; z_type r=81.*(a*a)+12.*(b*b*b);
z_type R=I*sqrt(-r);
z_type s=27.*a + 3.*R; z_type S=pow(s,1./3.);
z_type B=(0.26456684199469993*S)/q - (1.2599210498948732*b)/(q*S);
z_type h=0.25/q2 + B;
z_type H=-I*sqrt(-h);
z_type g=0.5/q2 - B + (.25+2.*q2)/(q3*H);
z_type G=-I*sqrt(-g);
return - 0.25/q - 0.5*H + 0.5*G ;}

z_type arnemR(z_type z){ DB q=Q; DB q2=q*q; DB q3=q2*q;
z_type a=q-z; z_type b=1.+4.*q*z; z_type r=81.*(a*a)+12.*(b*b*b);
z_type R=sqrt(r); z_type s=27.*a + 3.*R;
z_type S=pow(s,1./3.);
z_type B=(0.26456684199469993*S)/q - (1.2599210498948732*b)/(q*S);
z_type h=0.25/q2 + B;
z_type H=sqrt(h);
z_type g=0.5/q2 - B + (.25+2.*q2)/(q3*H);
z_type G=sqrt(g);
return - 0.25/q - 0.5*H + 0.5*G ;}

z_type arnemL(z_type z){ DB q=Q; DB q2=q*q; DB q3=q2*q;
z_type a=q-z; z_type b=1.+4.*q*z; z_type r=81.*(a*a)+12.*(b*b*b);
z_type R=-sqrt(r);
z_type s=27.*a + 3.*R; z_type S=pow(s,1./3.);
z_type B=(0.26456684199469993*S)/q - (1.2599210498948732*b)/(q*S);
z_type h=0.25/q2 + B;
z_type H=sqrt(h);
z_type g=0.5/q2 - B + (.25+2.*q2)/(q3*H);
z_type G=sqrt(g);
return - 0.25/q - 0.5*H + 0.5*G ;}

z_type arqnem(z_type z){ DB x,y; x=Re(z);y=Im(z);
if( y>ti || (x<0 && y>=0)) return arnemU(z);
//if(y<0) return conj(arnemU(conj(z)));
if(y<-ti || (x<0 && y<=0)) return arnemD(z);
if(x*ti>fabs(y)*tr) return arnemR(z);
return arnemL(z);
}

/* */