F4ten.cin

From Citizendium
Jump to navigation Jump to search

// F4ten.cin is C++ routine for evaluation of tetration to base 10 by the Cauchi integral, using its values along the imaginary axis stored at f2048ten.inc (this file is supposed to be loaded in the working directory) and the Transfer equation for the exponential to base 10 as transfer function.

// The integral is evaluated using the Gauss-Legendre quadrature formula; the nodes and weights are stored in GLxw2048.inc .

z _type f4ten(z_type z){ //NOT SHIFTED FOR x1 !!!!
#include "GLxw2048.inc"
z_type tenZo=z_type(-0.119193073414549, 0.750583293932439);
z_type tenZc=z_type(-0.119193073414549,-0.750583293932439);

DB Lten= 2.302585092994046;
z_type tenQ=z_type( 0.559580251215472, 1.728281903659204);// =L*Zo+log(L) 
z_type tenT=z_type( 3.290552906607012, 1.065409768058325);
// #include "tenzo.inc"
       #include"f2048ten.inc"
       //Aten is defined there
        int j,k,m,n; DB x,y, u, t; z_type c,d, cu,cd;
       z_type E[K],G[K];
       DO(k,K){c=F[k];E[k]=log(c)/Lten;G[k]=exp(c*Lten);}
//      the initioalization abouve should run at the compillation
       c=0.;
       DO(k,K){t=Aten*GLx[k]; c+= GLw[k]*( G[k]/(z_type( 1.,t)-z) - E[k]/(z_type(-1.,t)-z) );}
       cu=.5-I/(2.*M_PI)*log( (z_type(1.,-Aten)+z)/(z_type(1., Aten)-z) );
       cd=.5-I/(2.*M_PI)*log( (z_type(1.,-Aten)-z)/(z_type(1., Aten)+z) );
       return c*(Aten/(2.*M_PI)) +tenZo*cu+tenZc*cd;
}
DB x1ten= 0.0377406857309657;
//#include "figx1ten.inc"
DB Lten=log(10.);
z_type F4TEN(z_type z){ DB x=Re(z);
//                      DB L=log(2.);
                       if(x<-.5) return log(F4TEN(z+1.))/Lten; 
                       if(x> .5) return exp(F4TEN(z-1.)*Lten); 
                       return f4ten(z+x1ten);
               }

// // Cource: http://tori.ils.uec.ac.jp/TORI1064/index.php/F4ten.cin