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-lang intrinsic descriptions


Nemo Release 3.1 log_gamma (3fortran) April 28, 2024
Generated by manServer 1.08 from b46c194e-75ee-472c-a08d-efcdbb5580b7 using man macros.