Back to index

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

Go to the source code of this file.

Functions

long double __tanl (long double x)

Function Documentation

long double __tanl ( long double  x)

Definition at line 57 of file s_tanl.c.

{
       long double y[2],z=0.0;
       int32_t n, se;

    /* High word of x. */
       GET_LDOUBLE_EXP(se,x);

    /* |x| ~< pi/4 */
       se &= 0x7fff;
       if(se <= 0x3ffe) return __kernel_tanl(x,z,1);

    /* tan(Inf or NaN) is NaN */
       else if (se==0x7fff) return x-x;          /* NaN */

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

Here is the call graph for this function: