Difapro.cin

From TORI
Jump to navigation Jump to search

/*


Difapro.cin is C++ approximation of deviation between the two descending superexponentials to base sqrt2. */

z_type f43Ep(z_type z){   DB b=sqrt(2.); int n; z_type e,s; DB coeudp[21],k,q; // derivative
DB coeu[21]={1.,
 0.44858743119526122890, .19037224679780675668, 
 0.77829576536968278770e-1, 0.30935860305707997953e-1, 
 0.12022125769065893274e-1, 0.45849888965617461424e-2,
 0.17207423310577291102e-2, 0.63681090387985537364e-3,
 0.23276960030302567773e-3, 0.84145511838119915857e-4,
 0.30115646493706434120e-4, 0.10680745813035087964e-4,
 0.37565713615564248453e-5, 0.13111367785052622794e-5,
 0.45437916254218158081e-6, 0.15642984632975371803e-6,
 0.53523276400816416929e-7, 0.18207786280204973113e-7,  
 0.61604764947389226744e-8, 0.2e-8
};
                k=0.32663425997828098238;              
                DO(n,21) {      if(n/2*2==n) coeudp[n]=- coeu[n]*(n+1.)*k;
                                else         coeudp[n]=  coeu[n]*(n+1.)*k;}
                e=exp(k*(z+1.90057764535875));
		s=coeudp[20];  
		for(n=19;n>=0;n--) { s*=e; s+=coeudp[n]; }
                return s*e;  }
z_type F43EP(z_type z){ DB b=sqrt(2.);
                        if(Re(z)<-2.) return f43Ep(z);
                        return exp(F43E(z-1.)*log(b))*log(b)*F43EP(z-1.);}

//z_type difapro(z_type z){ DB h=.74633986; return .72521764e-24*(sin(h+2*M_PI*z)-sin(h))*F43EP(z); }
 z_type difapro(z_type z){ DB h,i;
//       h=.74633984;           i=.72521755e-24;
         h=.74633983476   ;     i=.7252175546e-24;
        return i*(sin(h+2*M_PI*z)-sin(h))*F43EP(z); }
/////////////////////////////////////////////////////////////

References