gamma man page on OPENSTEP

Man page or keyword search:  
man Server   1419 pages
apropos Keyword Search (all sections)
Output format
OPENSTEP logo
[printable version]


LGAMMA(3M)							    LGAMMA(3M)

NAME
       lgamma - log gamma function

SYNOPSIS
       #include <math.h>

       double lgamma(x)
       double x;

DESCRIPTION
       Lgamma returns ln|Γ(x)|.

       The external integer signgam returns the sign of Γ(x) .

IDIOSYNCRASIES
       Do  not use the expression signgam∗exp(lgamma(x)) to compute g := Γ(x).
       Instead use a program like this (in C):
	      lg = lgamma(x); g = signgam∗exp(lg);

       Only after lgamma has returned can signgam be correct.  Note  too  that
       Γ(x)  must  overflow when x is large enough, underflow when -x is large
       enough, and spawn a division by zero when x is a nonpositive integer.

       Only in the UNIX math library for C was the name gamma ever attached to
       lnΓ.   Elsewhere, for instance in IBM's FORTRAN library, the name GAMMA
       belongs to Γ and the name ALGAMA to lnΓ in single precision; in	double
       the names are DGAMMA and DLGAMA.	 Why should C be different?

       Archaeological  records	suggest	 that  C's  gamma originally delivered
       ln(Γ(|x|)).  Later, the program gamma was changed to cope with negative
       arguments  x  in a more conventional way, but the documentation did not
       reflect	that  change  correctly.   The	most  recent  change  corrects
       inaccurate values when x is almost a negative integer, and lets Γ(x) be
       computed	 without  conditional  expressions.   Programmers  should  not
       assume that lgamma has settled down.

       At  some	 time  in the future, the name gamma will be rehabilitated and
       used for the gamma function, just as is done in	FORTRAN.   The	reason
       for  this  is  not  so  much  compatibility with FORTRAN as a desire to
       achieve greater speed for smaller values of |x|	and  greater  accuracy
       for larger values.

       Meanwhile,  programmers	who  have  to use the name gamma in its former
       sense, for what is now lgamma, have two choices:

       1) Use the old math library, libom.

       2) Add the following program to your others:
	  #include <math.h>
	  double gamma(x)
	  double x;
	  {
		 return (lgamma(x));
	  }

SEE ALSO
       math(3M)

4.3 Berkeley Distribution	 May 12, 1986			    LGAMMA(3M)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OPENSTEP

List of man pages available for OPENSTEP

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net