3 * Circular tangent of angle in degrees
9 * float x, y, tandgf();
17 * Returns the circular tangent of the radian argument x.
19 * Range reduction is into intervals of 45 degrees.
27 * arithmetic domain # trials peak rms
28 * IEEE +-2^24 50000 2.4e-7 4.8e-8
32 * message condition value returned
33 * tanf total loss x > 2^24 0.0
38 * Circular cotangent of angle in degrees
44 * float x, y, cotdgf();
52 * Range reduction is into intervals of 45 degrees.
53 * A common routine computes either the tangent or cotangent.
60 * arithmetic domain # trials peak rms
61 * IEEE +-2^24 50000 2.4e-7 4.8e-8
66 * message condition value returned
67 * cot total loss x > 2^24 0.0
68 * cot singularity x = 0 MAXNUMF
73 Cephes Math Library Release 2.2: June, 1992
74 Copyright 1984, 1987, 1989, 1992 by Stephen L. Moshier
75 Direct inquiries to 30 Frost Street, Cambridge, MA 02140
78 /* Single precision circular tangent
79 * test interval: [-pi/4, +pi/4]
81 * peak relative error: 8.7e-8
82 * rms relative error: 2.8e-8
88 static float T24M1 = 16777215.;
89 static float PI180 = 0.0174532925199432957692; /* pi/180 */
91 static float tancotf( float xx, int cotflg )
98 /* make argument positive but save the sign */
113 mtherr( "cotdgf", TLOSS );
115 mtherr( "tandgf", TLOSS );
119 /* compute x mod PIO4 */
120 j = 0.022222222222222222222 * x; /* integer part of x/45 */
123 /* map zeros and singularities to origin */
131 z *= PI180; /* multiply by pi/180 to convert to radians */
137 /* 1.7e-8 relative error in [-pi/4, +pi/4] */
139 ((((( 9.38540185543E-3 * zz
140 + 3.11992232697E-3) * zz
141 + 2.44301354525E-2) * zz
142 + 5.34112807005E-2) * zz
143 + 1.33387994085E-1) * zz
144 + 3.33331568548E-1) * zz * z
164 mtherr( "tandgf", SING );
177 mtherr( "cotdgf", SING );
190 float tandgf( float x )
193 return( tancotf(x,0) );
196 float cotdgf( float x )
201 mtherr( "cotdgf", SING );
204 return( tancotf(x,1) );