This function evaluates the cotangent.

** COT** — Function
value. (Output)

** X** — Angle in
radians for which the cotangent is desired. (Input)

Specific: The specific interface names are COT, DCOT, CCOT, and ZCOT.

Double: The double precision function name is DCOT.

Complex: The complex name is CCOT.

Double Complex: The double complex name is ZCOT.

For real x, the magnitude of *x* must not be so large
that most of the computer word contains the integer part of *x*. Likewise,
*x* must not be too near an integer multiple of π, although *x* close
to the origin causes no accuracy loss. Finally, *x* must not be so close to
the origin that COT(X)
≈ 1/*x* overflows.

For complex arguments, let *z* = *x* + *iy*.
If |sin *z*|2 is very small, that
is, if *x* is very close to a multiple of π and if |*y*| is small,
then cot *z* is nearly singular and a fatal error condition is reported. If
|sin *z*|2 is somewhat larger but
still small, then the result will be less accurate than half precision. When
|2*x*| is so large that sin 2*x* cannot be evaluated accurately to
even zero precision, the following situation results. If |*y*| < 3/2,
then CCOT
cannot be evaluated accurately to be better than one significant figure. If 3/2
≤|*y*| < -1/2 ln ε/2, where ε = AMACH(4)
is the machine precision, then CCOT
can be evaluated by ignoring the real part of the argument; however, the answer
will be less accurate than half precision. Finally, |*z*| must not be so
small that cot *z* ≈ 1/*z* overflows.

Informational error for Real arguments

3 2 Result of COT(X) is accurate to less than one-half precision because ABS(X) is too large, or X is nearly a multiple of π.

Informational error for Complex arguments

3 2 Result of CCOT(Z) is accurate to less than one-half precision because the real part of Z is too near a multiple of π when the imaginary part of Z is zero, or because the absolute value of the real part is very large and the absolute value of the imaginary part is small.

1. Referencing COT(X) is NOT the same as computing 1.0/TAN(X) because the error conditions are quite different. For example, when X is near π /2, TAN(X) cannot be evaluated accurately and an error message must be issued. However, COT(X) can be evaluated accurately in the sense of absolute error.

In this example, cot(0.3) is computed and printed.

99999 FORMAT (' COT(', F6.3, ') = ', F6.3)

In this example, cot(1 + *i*) is computed and
printed.

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

COT(( 1.000, 1.000)) = ( 0.218,-0.868)

http://www.vni.com/PHONE: 713.784.3131 FAX:713.781.9260 |