Back to index

glibc  2.9
Functions
s_tanf.c File Reference
#include "math.h"
#include "math_private.h"

Go to the source code of this file.

Functions

float __tanf (float x)

Function Documentation

float __tanf ( float  x)

Definition at line 26 of file s_tanf.c.

{
       float y[2],z=0.0;
       int32_t n, ix;

       GET_FLOAT_WORD(ix,x);

    /* |x| ~< pi/4 */
       ix &= 0x7fffffff;
       if(ix <= 0x3f490fda) return __kernel_tanf(x,z,1);

    /* tan(Inf or NaN) is NaN */
       else if (ix>=0x7f800000) return x-x;             /* NaN */

    /* argument reduction needed */
       else {
           n = __ieee754_rem_pio2f(x,y);
           return __kernel_tanf(y[0],y[1],1-((n&1)<<1)); /*   1 -- n even
                                                       -1 -- n odd */
       }
}

Here is the call graph for this function: