Back to index

glibc  2.9
Functions
s_tanl.c File Reference
#include "math.h"
#include "math_private.h"
This graph shows which files directly or indirectly include this file:

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 53 of file s_tanl.c.

{
       long double y[2],z=0.0L;
       int64_t n, ix;

    /* High word of x. */
       GET_LDOUBLE_MSW64(ix,x);

    /* |x| ~< pi/4 */
       ix &= 0x7fffffffffffffffLL;
       if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanl(x,z,1);

    /* tanl(Inf or NaN) is NaN */
       else if (ix>=0x7fff000000000000LL) 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: