Manual Reference Pages  - log_gamma (3fortran)

NAME

LOG_GAMMA(3) - [MATHEMATICS] Logarithm of the absolute value of the Gamma function

SYNOPSIS

result = log_gamma(x)

         elemental real(kind=KIND) function log_gamma(x)

real(kind=KIND),intent(in) :: x

CHARACTERISTICS

o X may be any real type
o the return value is of same type and kind as X.

DESCRIPTION

LOG_GAMMA(3) computes the natural logarithm of the absolute value of the Gamma function.

OPTIONS

o X : neither negative nor zero value to render the result for.

RESULT

The result has a value equal to a processor-dependent approximation to the natural logarithm of the absolute value of the gamma function of X.

EXAMPLES

Sample program:

    program demo_log_gamma
    implicit none
    real :: x = 1.0
       write(*,*)x,log_gamma(x) ! returns 0.0
       write(*,*)x,log_gamma(3.0) ! returns 0.693 (approximately)
    end program demo_log_gamma

Results:

     >    1.000000      0.0000000E+00
     >    1.000000      0.6931472

STANDARD

Fortran 2008

SEE ALSO

Gamma function: GAMMA(3)

Fortran intrinsic descriptions


Nemo Release 3.1 log_gamma (3fortran) November 02, 2024
Generated by manServer 1.08 from 83320794-8766-49bb-9eac-650684cf9275 using man macros.