F15.cin

From Citizendium
Jump to navigation Jump to search

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

The routine is copypasted from TORI, http://mizugadro.mydns.jp/t/index.php/F2048b15.inc

z_type should be defined as complex<double> (or something you like, at your own risk). Then, the routine can be called as z_type F15(z_type z) for complex z; the first letter of the function name in this call must be capital.

Description of the algorithm of evaluation is available [1][2].

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.

Code

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); DB x1b15= 0.1635588901442990; #include "GLxw2048.inc" z_type f15(z_type z){ //NOT SHIFTED FOR x1 !!!! #include"f2048b15.inc" int j,k,m,n; DB x,y, u, t; z_type c,d, cu,cd; z_type E[2048],G[2048]; DO(k,K){c=F[k];E[k]=log(c)/L15;G[k]=exp(c*L15);} 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); }

References

D.Kouznetsov. Holomorphic ackermanns. 2015, in preparation.