ACOS

This function extends FORTRAN’s generic ACOS function to evaluate the complex arc cosine.

Function Return Value

ACOS — Complex function value in units of radians with the real part in the first or second quadrant. (Output)

Required Arguments

Z — Complex argument for which the arc cosine is desired. (Input)

FORTRAN 90 Interface

Generic: ACOS (Z)

Specific: The specific interface names are CACOS and ZACOS.

FORTRAN 77 Interface

Complex: CACOS (Z)

Double complex:  The double complex function name is ZACOS.

Description

Almost all arguments are legal. Only when z > b/2 can an overflow occur. Here, b = AMACH(2) is the largest floating point number. This error is not detected by ACOS.

Example

In this example, cos‑1(1  i) is computed and printed.

 

USE ACOS_INT

USE UMACH_INT

 

IMPLICIT NONE

! Declare variables

INTEGER NOUT

COMPLEX VALUE, Z

! Compute

Z = (1.0, -1.0)

VALUE = ACOS(Z)

! Print the results

CALL UMACH (2, NOUT)

WRITE (NOUT,99999) Z, VALUE

99999 FORMAT (' ACOS((', F6.3, ',', F6.3, ')) = (', &

F6.3, ',', F6.3, ')')

END

Output

 

ACOS(( 1.000,-1.000)) = ( 0.905, 1.061)