3
* Circular tangent of argument in degrees
9
* double x, y, tandg();
17
* Returns the circular tangent of the argument x in degrees.
19
* Range reduction is modulo pi/4. A rational function
20
* x + x**3 P(x**2)/Q(x**2)
21
* is employed in the basic interval [0, pi/4].
28
* arithmetic domain # trials peak rms
29
* DEC 0,10 8000 3.4e-17 1.2e-17
30
* IEEE 0,10 30000 3.2e-16 8.4e-17
34
* message condition value returned
35
* tandg total loss x > 8.0e14 (DEC) 0.0
37
* tandg singularity x = 180 k + 90 MAXNUM
41
* Circular cotangent of argument in degrees
47
* double x, y, cotdg();
55
* Returns the circular cotangent of the argument x in degrees.
57
* Range reduction is modulo pi/4. A rational function
58
* x + x**3 P(x**2)/Q(x**2)
59
* is employed in the basic interval [0, pi/4].
64
* message condition value returned
65
* cotdg total loss x > 8.0e14 (DEC) 0.0
67
* cotdg singularity x = 180 k MAXNUM
71
Cephes Math Library Release 2.0: April, 1987
72
Copyright 1984, 1987 by Stephen L. Moshier
73
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
79
static double PI180 = 1.74532925199432957692E-2;
80
static double lossth = 1.0e14;
84
static unsigned short P1[] = {0036616,0175065,0011224,0164711};
85
#define PI180 *(double *)P1
86
static double lossth = 8.0e14;
90
static unsigned short P1[] = {0x9d39,0xa252,0xdf46,0x3f91};
91
#define PI180 *(double *)P1
92
static double lossth = 1.0e14;
96
static unsigned short P1[] = {
97
0x3f91,0xdf46,0xa252,0x9d39
99
#define PI180 *(double *)P1
100
static double lossth = 1.0e14;
103
static double tancot(double, int);
104
extern double MAXNUM;
109
return( tancot(x,0) );
116
return( tancot(x,1) );
121
tancot(double xx, int cotflg)
126
/* make argument positive but save the sign */
136
mtherr("tandg", TLOSS);
141
x = x - 180.0*floor(x/180.0);
157
} else if (x == 45.0) {
159
} else if (x == 90.0) {
160
mtherr( (cotflg ? "cotdg" : "tandg"), SING );
163
/* x is now transformed into [0, 90) */
164
return sign * tan(x*PI180);