Nembran.cin

// Nembran.cin is routine for evaluation of the complex branch point of function ArqNem, whish is inverse function of the Nemtsov function. The same is also branch point of two other inverse functions of the Nemtsov Finction, ArcNem and ArkNem, but namely ArqNem is required for evaluation of the Abel function AuNem of the Nemtsov function. // The code below is not perfect, but I have tested it for various real q, and it seems to do that it is supposed to do.

/*
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <complex>
typedef std::complex<double> z_type;
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
*/

z_type nem(DB q,z_type z){ return z*(1.+z*z*(1.+z*q)); }
z_type nem1(DB q,z_type z){ return 1.+z*z*(3.+z*(4.*q)); }
z_type nembra0(DB q){
return -0.5773502691896258*I+
q*(2./9+
q*(0.2138334330331947*I+
q*(-0.2633744855967078 +
q*(-0.3658927631901332*I+
q*(0.5462581923487273 +
q*(0.8556857213229570*I+
q*(-1.387322393266609
))))))) ;}

z_type nembrao(DB q){ z_type x,y,z,s; x=conj(pow(z_type(-.25/q,0.),1./3.)); y=x*x; z=y*y;
s=1.+y*(1.+y*(1.+y*(2./3.+z*(-2./3.+y*(-7./9.+z*(11./9.+y*(130./91.)
) ) ) ) ) );
return s*x;}

z_type nembra(DB q){
if(fabs(q)<.021) return nembra0(q);
if(fabs(q) >20.) return nembrao(q);
z_type Q,v,V; Q=q*q; v=-1.-8.*Q+4.*sqrt(Q+4.*Q*Q); V=pow(v,1./3.); return (.25/q)*(-1.+1./V+V); }

z_type nembran(DB q){ return conj(nem(q,nembra(q)));}

//