E1etf.cin

// e1etf.cin is routine that evaluates tetration to Henryk base η=exp(1/e).

// Call it with capitals: z_type E1ETF(z_type z)

// z_type should be defined as, for example, complex

z_type e1etf(z_type z){ int n,N; z_type c,f; z+=2.798248154231454; z_type t=log(z); z_type u=-1./(3.*z); z_type s[16]; s[0]= 1.; s[1]= t; s[2]= t*(t- 1. )+ .5; s[3]= t*(t*(t- 5/ 2.)+ 5/ 2.)- 7/10.; s[4]= t*(t*(t*(t- 13/ 3.)+ 45/ 6.)- 53/10.)+ 67/60.; s[5]= t*(t*(t*(t*(t- 77/12.)+ 101/ 6.)- 83/ 4.)+ 653/60.)- 2701/1680.; s[6]= t*(t*(t*(t*(t*(t- 87/10.)+ 95/ 3.)- 175/ 3.)+ 267/ 5.)-17245/ 840.)+ 92461/42000.; s[7]= t*(t*(t*(t*(t*(t*(t-223/20.)+1591/30.)- 535/ 4.)+ 5488/30.)-30061/ 240.)+ 503159/14000.)-348617/84000.; s[8]=t*(t*(t*(t*(t*(t*(t*(t-481/35.)+2947/36.)-8011/30.)+29977/60.)- 9305/ 18.)+11298583/42000.)-580789/8400.)+4558331/352800.; s[9]=t*(t*(t*(t*(t*(t*(t*(t*(t-4609/280.)+16659/140.)-43417/90.)+349903/300.)-199529/120.)+166822247./126000.) -48732671./84000.)+21806039./117600.)-12523881847./388080000.; N=9; c=s[N]*u; for(n=N-1;n>0;n-=1){c+=s[n];c*=u;} c+=1.; return M_E*(1.-(2./z)*c); }

z_type E1ETF(z_type z){ if(Re(z)>12) return e1etf(z); if(fabs(Im(z))<5.)return log(E1ETF(z+1.))*M_E; if(abs(z-3.)<16) return log(E1ETF(z+1.))*M_E; return e1etf(z); }