F15.cin

From TORI
Jump to: navigation, search

// F15.cin is C++ routine for evaluation of tetration to base 1.5

// The code below requires table of its values along a line parallel to the imaginary axis. This table is stored in file f2048b15.inc and also should be loaded.



//z_type Zo=z_type(.31813150520476413, 1.3372357014306895);
//z_type Zc=z_type(.31813150520476413,-1.3372357014306895); // Natural base
z_type Zo15=z_type( 2.306009391950022, 1.081988656014367);
z_type Zc15=z_type( 2.306009391950022,-1.081988656014367);
DB L15=log(1.5);// 0.405465108108164
z_type Q15=z_type( 0.032285891687578, 0.438708647382672);// =L*Zo+log(L)
z_type T15=z_type(14.244850994834851, 1.048321520600793);
//#include "Zo15.inc"

//#include "x1b15.inc"
DB x1b15= 0.1635588901442990;

#include "GLxw2048.inc"
//DB L=log(2.);
z_type f15(z_type z){ //NOT SHIFTED FOR x1 !!!!
#include"f2048b15.inc"
//K and A15 are defined there
int j,k,m,n; DB x,y, u, t; z_type c,d, cu,cd;
z_type E[2048],G[2048];
// z_type E[K],G[K];
DO(k,K){c=F[k];E[k]=log(c)/L15;G[k]=exp(c*L15);}
// the initioalization abouve should run at the compillation
c=0.;
        DO(k,K){t=A15*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.,-A15)+z)/(z_type(1., A15)-z) );
        cd=.5-I/(2.*M_PI)*log( (z_type(1.,-A15)-z)/(z_type(1., A15)+z) );
        return c*(A15/(2.*M_PI)) +Zo15*cu+Zc15*cd;
}

z_type F15(z_type z){ DB x=Re(z);
if(x<-.5) return log(F15(z+1.))/L15;
if(x> .5) return exp(F15(z-1.)*L15);
return f15(z+x1b15);
}

/* */