Difference between revisions of "File:FactoReal.jpg"

From TORI
Jump to navigation Jump to search
($ -> \( ; refs ; pre ; keywords)
 
Line 1: Line 1:
  +
{{oq|FactoReal.jpg|Original file ‎(915 × 1,310 pixels, file size: 141 KB, MIME type: image/jpeg)}}
  +
 
Factorial of the real argument. Copy from
 
Factorial of the real argument. Copy from
 
http://en.citizendium.org/wiki/Image:FactoReal.jpg
 
http://en.citizendium.org/wiki/Image:FactoReal.jpg
Line 6: Line 8:
 
<math>\mathrm{factorial}(x)^{-1}</math>, blue.<br>
 
<math>\mathrm{factorial}(x)^{-1}</math>, blue.<br>
 
The extremal points are marked with pink:
 
The extremal points are marked with pink:
<math>\mathrm{factorial}'(\nu_n)=0</math>;
 
<math>\mu_n=\mathrm{factorial}(\nu_n)</math>.
 
   
 
\[\mathrm{factorial}'(\nu_n)=0\]
==[[C++]] generator of curfes==
 
  +
 
\[\mu_n=\mathrm{factorial}(\nu_n)\]
  +
  +
This picture appears as Fig.8.2 at page 91 of book
  +
«[[Superfunctions]]»<ref>
  +
https://www.amazon.co.jp/Superfunctions-Non-integer-holomorphic-functions-superfunctions/dp/6202672862 Dmitrii Kouznetsov. [[Superfunctions]]: Non-integer iterates of holomorphic functions. [[Tetration]] and other [[superfunction]]s. Formulas,algorithms,tables,graphics - 2020/7/28
  +
</ref><ref>https://mizugadro.mydns.jp/BOOK/468.pdf Dmitrii Kouznetsov (2020). [[Superfunctions]]: Non-integer iterates of holomorphic functions. [[Tetration]] and other [[superfunction]]s. Formulas, algorithms, tables, graphics. Publisher: [[Lambert Academic Publishing]].
  +
</ref>
  +
<br>
  +
in order to show notations and to avoid confusion of
  +
  +
\(\mathrm{Factorial}^m(z) \) with
  +
  +
\(\mathrm{Factorial}(z)^m \)
  +
  +
The case of \(m=-1\) is presented in the picture.
  +
  +
The picture is one of tests of the complex double implementation of [[Factorial]].
  +
<br>
  +
Namely for the real-real plot, the build-in function [[tgamma]]
  +
<ref>
  +
https://www.geeksforgeeks.org/cpp/tgamma-method-in-c-c-with-examples/
  +
gamma() method in C/C++ with Examples
  +
Last Updated : 12 Jul, 2025
  +
The [[tgamma]]() function is defined in header math.h header in C and cmath library in C++. This function is used to compute the gamma function of an argument passed to the function.
  +
loat tgamma(float x);
  +
double tgamma(double x);
  +
long double tgamma(long double x);
  +
</ref> could be used instead.<br>
  +
At the moment of preparation of the Book,
  +
complex double tgamma(complex double x) is not yet implemented as a built-in function;
  +
for this reason, the testing of the routine for the complex Factorial is important.
  +
 
==[[C++]] generator of curves==
 
// Code of generator of this image from http://en.citizendium.org/wiki/Factorial/Code/FactoReal
 
// Code of generator of this image from http://en.citizendium.org/wiki/Factorial/Code/FactoReal
   
Line 117: Line 151:
   
 
==References==
 
==References==
  +
{{ref}}
<references/>
 
  +
https://citizendium.org/wiki/File:FactoReal.jpg
  +
  +
{{fer}}
  +
  +
==Keywords==
  +
  +
«[[Factorial]]»,
  +
«[[Table of superfunctions]]»,
  +
«[[Transfer equation]]»,
  +
«[[Superfunctions]]»,
   
 
[[Category:Book]]
 
[[Category:Book]]
 
[[Category:BookPlot]]
 
[[Category:BookPlot]]
 
[[Category:plots of functions]]
 
[[Category:plots of functions]]
[[Category:Files from CZ]]
+
[[Category:CZ]]
 
[[Category:Factorial]]
 
[[Category:Factorial]]
 
[[Category:Explicit plot]]
 
[[Category:Explicit plot]]

Latest revision as of 21:57, 21 August 2025


Factorial of the real argument. Copy from http://en.citizendium.org/wiki/Image:FactoReal.jpg

Graphic of factorial\((x)=x!\) versus real \(x\), red; \(\mathrm{factorial}^{-1}(x)\), green; \(\mathrm{factorial}(x)^{-1}\), blue.
The extremal points are marked with pink:

\[\mathrm{factorial}'(\nu_n)=0\]

\[\mu_n=\mathrm{factorial}(\nu_n)\]

This picture appears as Fig.8.2 at page 91 of book «Superfunctions»[1][2]
in order to show notations and to avoid confusion of

\(\mathrm{Factorial}^m(z) \) with

\(\mathrm{Factorial}(z)^m \)

The case of \(m=-1\) is presented in the picture.

The picture is one of tests of the complex double implementation of Factorial.
Namely for the real-real plot, the build-in function tgamma [3] could be used instead.
At the moment of preparation of the Book, complex double tgamma(complex double x) is not yet implemented as a built-in function; for this reason, the testing of the routine for the complex Factorial is important.

C++ generator of curves

// Code of generator of this image from http://en.citizendium.org/wiki/Factorial/Code/FactoReal

// FactoReal.cc , source of the figure
FactoReal.jpg
// http://en.citizendium.org/wiki/Image:FactoReal.jpg
// which represents the factorial of the real argument.
// Copyleft 2009 by Dmitrii Kouznetsov.
// Feel free to use, post, redistribute and even modify the code below,
// but please indicate the source and the modifications if any.
// Such indications help a lot to correct bugs if any.
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
#include <complex.h>
#define z_type complex<double>
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
DB expaunoc[31]= {1.,
 0.5772156649015329,    -0.6558780715202537,	 -0.04200263503409518,    0.16653861138229112,
-0.04219773455554465,   -0.009621971527877027,   0.0072189432466631676, -0.0011651675918590183,
-0.0002152416741149077,  0.00012805028238804805,-0.00002013485478102872,-1.2504934818746705e-6,
 1.1330272320364543e-6, -2.0563384228733383e-7,  6.1160952968819515e-9,  5.00200766282674e-9, 
-1.1812748557105124e-9,  1.0434320074637071e-10, 7.782441358017422e-12, -3.696820627396846e-12,
 5.10702591327572e-13,  -2.0650148258027912e-14,-6.217248937900877e-15,  7.771561172376096e-16,
-9.992007221626409e-16, -3.3306690738754696e-16, 5.551115123125783e-16, -1.1102230246251565e-16,
 1.3322676295501878e-15, 9.992007221626409e-16 };
 z_type expauno(z_type z) {int n,m; DB x,y; z_type s; s=expaunoc[24];
		x=Re(z);if(x<-.9) return expauno(z+1.)-log(z+1.);
			if(x>.5) return expauno(z-1.)+log(z);
		y=Im(z); if(fabs(y)>.7)return expauno(z/2.)+expauno(z/2.-.5)+z*log(2.)-log(sqrt(M_PI));
		for(n=23; n>=0; n--) { s*=z;s+=expaunoc[n]; } 			return -log(s); }
z_type fracti(z_type z){ z_type s; int n;  DB a[17]=
{0.0833333333333333333, 0.0333333333333333333,  .252380952380952381, .525606469002695418, 
 1.01152306812684171,   1.51747364915328740,   2.26948897420495996, 3.00991738325939817, 
 4.02688719234390123,   5.00276808075403005,   6.28391137081578218, 7.49591912238403393, 
 9.04066023436772670,  10.4893036545094823,   12.2971936103862059, 13.9828769539924302, 16.0535514167049355
};
/* a[0]=1./12.; a[1]=1./30.; a[2]=53./210.; a[3]=195./371.; a[4]=22999./22737.; a[5]=29944523./19773142.;
a[6]=109535241009./48264275462.;  a[7]=29404527905795295658./9769214287853155785.;
a[8]=455377030420113432210116914702./113084128923675014537885725485.;
a[9]=26370812569397719001931992945645578779849./5271244267917980801966553649147604697542.;
a[10]=152537496709054809881638897472985990866753853122697839./24274291553105128438297398108902195365373879212227726.;
a[11]= too long... */
s=a[16]/(z+19./(z+25./(z))); 
for(n=15;n>=0;n--) s=a[n]/(z+s);
return  s + log(2.*M_PI)/2. - z + (z+.5)*log(z);
}
z_type lofac(z_type z){DB x,y,r;
       x=Re(z); y=Im(z);
        if(fabs(y)>5 ) return fracti(z);
        if(x>0 && (x-3)*(x-3.)+y*y >25) return fracti(z);
        return expauno(z);
       }
void ado(FILE *O, int x, int y, int X, int Y)
{	fprintf(O,"%c!PS-Adobe-2.0 EPSF-2.0\n",'%');
	fprintf(O,"%c%cBoundingBox: %d %d %d %d\n",'%','%',x,y,X,Y);
	fprintf(O,"/M {moveto} bind def\n");
	fprintf(O,"/L {lineto} bind def\n");
	fprintf(O,"/S {stroke} bind def\n");
	fprintf(O,"/s {show newpath} bind def\n");
	fprintf(O,"/C {closepath} bind def\n");
	fprintf(O,"/F {fill} bind def\n");
	fprintf(O,"/times-Roman findfont 20 scalefont setfont\n");
	fprintf(O,"/W {setlinewidth} bind def\n");
	fprintf(O,"/RGB {setrgbcolor} bind def\n");}

#define fac(z) exp(lofac(z))
main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d, cu,cd;
FILE *o;o=fopen("FactoReal.eps","w");ado(o,0,0,98,144);
#define M(x,y) fprintf(o,"%8.5f %8.5f M\n",0.+x, 0.+y);
#define L(x,y) fprintf(o,"%8.5f %8.5f L\n",0.+x, 0.+y);
fprintf(o,"41 71 translate\n 10 10 scale\n");
for(m=-3;m<4;m++) {	if(m==0){M(m,-6.2)L(m,6.2)} else	{M(m,-6)L(m,6)}			}
for(n=-6;n<7;n++) {	M(  -3,n)L(3,n)}
fprintf(o,".006 W 0 0 0 RGB S\n");
	DO(m,24){x=-3.9744+.03933*m; z=x; y=Re(fac(z)); if(m==0)M(x,y) else L(x,y);}
	DO(m,21){x=-2.921+.039*m; z=x; y=Re(fac(z)); if(m==0)M(x,y) else L(x,y);}
	DO(m,20){x=-1.832+.0347*m; z=x; y=Re(fac(z)); if(m==0)M(x,y) else L(x,y);}
	DO(m,41){x=-0.866+.0999*m; z=x; y=Re(fac(z)); if(m==0)M(x,y) else L(x,y);}
fprintf(o,"1 setlinejoin 1 setlinecap .02 W 1 0 0 RGB S\n");
DO(m,176){x=-4+.05*m; z=x; y=Re(exp(-lofac(z))); if(m==0)M(x,y) else L(x,y);}
fprintf(o,"1 setlinejoin 1 setlinecap .02 W 0 0 1 RGB S\n");
DO(m,61){y=.4616321450 +.04*m; x=Re(fac(y)); if(m==0)M(x,y) else L(x,y);}
fprintf(o,"1 setlinejoin 1 setlinecap .02 W 0 .8 0 RGB S\n");
M(-1.504083   ,0) L(-1.504083,    Re(fac(-1.504083  )))  L(0,Re(fac(-1.504083)))
              M(-1.504083,    Re(1./fac(-1.504083  )))  L(0,1./Re(fac(-1.504083)))
M( .4616321450,0) L(  .4616321450,1./Re(fac(.4616321450)))  L(0,1/Re(fac(.4616321450)))
                 M(  .4616321450,Re(fac(.4616321450)))  L(0,Re(fac(.4616321450)))
M(0, .4616321450) L(  Re(fac(.4616321450)),.4616321450) L(  Re(fac(.4616321450)),0)
fprintf(o,".01 W 1 0 1 RGB S\n");
fprintf(o,"showpage\n\%\%\%Trailer"); fclose(o);
//system( "ggv FactoReal.eps"); //for linux
  system("open FactoReal.eps"); //for macintosh
system("ps2pdf FactoReal.eps");
  getchar(); system("killall Preview"); //for macintosh
}

// end of generator of Image FactoReal.jpg

References

  1. https://www.amazon.co.jp/Superfunctions-Non-integer-holomorphic-functions-superfunctions/dp/6202672862 Dmitrii Kouznetsov. Superfunctions: Non-integer iterates of holomorphic functions. Tetration and other superfunctions. Formulas,algorithms,tables,graphics - 2020/7/28
  2. https://mizugadro.mydns.jp/BOOK/468.pdf Dmitrii Kouznetsov (2020). Superfunctions: Non-integer iterates of holomorphic functions. Tetration and other superfunctions. Formulas, algorithms, tables, graphics. Publisher: Lambert Academic Publishing.
  3. https://www.geeksforgeeks.org/cpp/tgamma-method-in-c-c-with-examples/ gamma() method in C/C++ with Examples Last Updated : 12 Jul, 2025 The tgamma() function is defined in header math.h header in C and cmath library in C++. This function is used to compute the gamma function of an argument passed to the function. loat tgamma(float x); double tgamma(double x); long double tgamma(long double x);

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:50, 20 June 2013Thumbnail for version as of 17:50, 20 June 2013915 × 1,310 (141 KB)Maintenance script (talk | contribs)Importing image file

The following 2 pages use this file:

Metadata