This function evaluates the derivative of the log gamma function.
PSI — Function value. (Output)
X — Argument for which the function value is desired. (Input)
Generic: PSI (X)
Specific: The specific interface names are S_PSI, D_PSI, and C_PSI.
Single: PSI (X)
Double: The double precision function name is DPSI.
Complex: The complex name is CPSI.
The psi function, also called the digamma function, is defined to be
See GAMMA for the definition of Γ(x).
The argument x must not be exactly zero or a negative integer, or ψ (x) is undefined. Also, x must not be too close to a negative integer such that the accuracy of the result is less than half precision.
Informational error
Type Code
3 2 Result of PSI(X) is accurate to less than one-half precision because X is too near a negative integer.
In this example, ψ(1.915) is computed and printed.
USE PSI_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NOUT
REAL VALUE, X
! Compute
X = 1.915
VALUE = PSI(X)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) X, VALUE
99999 FORMAT (' PSI(', F6.3, ') = ', F6.3)
END
PSI( 1.915) = 0.366
In this example, ψ (1.9 + 4.3i) is computed and printed.
USE PSI_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NOUT
COMPLEX VALUE, Z
! Compute
Z = (1.9, 4.3)
VALUE = PSI(Z)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) Z, VALUE
99999 FORMAT (' PSI(', F6.3, ',', F6.3, ') = (', F6.3, ',', F6.3, ')')
END
PSI( 1.900, 4.300) = ( 1.507, 1.255)
PHONE: 713.784.3131 FAX:713.781.9260 |