This funcion evaluates the cube root.
CBRT — Function value. (Output)
X — Argument for which the cube root is desired. (Input)
Generic: CBRT (X)
Specific: The specific interface names are S_CBRT, D_CBRT, C_CBRT, and Z_CBRT.
Single: CBRT (X)
Double: The double precision name is DCBRT.
Complex: The complex precision name is CCBRT.
Double Complex: The double complex precision name is ZCBRT.
The function CBRT(X) evaluates x1/3. All arguments are legal. For complex argument, x, the value of |x| must not overflow.
For complex arguments, the branch cut for the cube root is taken along the negative real axis. The argument of the result, therefore, is greater than –π/3 and less than or equal to π/3. The other two roots are obtained by rotating the principal root by 3 π/3 and π/3.
In this example, the cube root of 3.45 is computed and printed.
USE CBRT_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NOUT
REAL VALUE, X
! Compute
X = 3.45
VALUE = CBRT(X)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) X, VALUE
99999 FORMAT (' CBRT(', F6.3, ') = ', F6.3)
END
CBRT( 3.450) = 1.511
In this example, the cube root of –3 + 0.0076i is computed and printed.
IMPLICIT NONE
!
Declare variables
INTEGER NOUT
COMPLEX VALUE, Z
! Compute
Z = (-3.0, 0.0076)
VALUE = CBRT(Z)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) Z, VALUE
99999 FORMAT (' CBRT((', F7.4, ',', F7.4, ')) = (', &
F6.3, ',', F6.3, ')')
END
CBRT((-3.0000, 0.0076)) = ( 0.722, 1.248)
PHONE: 713.784.3131 FAX:713.781.9260 |