Back to index

glibc  2.9
Functions | Variables
s_atanl.c File Reference
#include "math_private.h"
#include <math_ldbl_opt.h>

Go to the source code of this file.

Functions

long double __atanl (long double x)
 long_double_symbol (libm, __atanl, atanl)

Variables

static const long double atantbl [84]
static const long double p0 = -4.283708356338736809269381409828726405572E1L
static const long double p1 = -8.636132499244548540964557273544599863825E1L
static const long double p2 = -5.713554848244551350855604111031839613216E1L
static const long double p3 = -1.371405711877433266573835355036413750118E1L
static const long double p4 = -8.638214309119210906997318946650189640184E-1L
static const long double q0 = 1.285112506901621042780814422948906537959E2L
static const long double q1 = 3.361907253914337187957855834229672347089E2L
static const long double q2 = 3.180448303864130128268191635189365331680E2L
static const long double q3 = 1.307244136980865800160844625025280344686E2L
static const long double q4 = 2.173623741810414221251136181221172551416E1L

Function Documentation

long double __atanl ( long double  x)

Definition at line 173 of file s_atanl.c.

{
  int k, sign;
  long double t, u, p, q;
  ieee854_long_double_shape_type s;

  s.value = x;
  k = s.parts32.w0;
  if (k & 0x80000000)
    sign = 1;
  else
    sign = 0;

  /* Check for IEEE special cases.  */
  k &= 0x7fffffff;
  if (k >= 0x7ff00000)
    {
      /* NaN. */
      if ((k & 0xfffff) | s.parts32.w1 )
       return (x + x);

      /* Infinity. */
      if (sign)
       return -atantbl[83];
      else
       return atantbl[83];
    }

  if (sign)
      x = -x;

  if (k >= 0x40248000) /* 10.25 */
    {
      k = 83;
      t = -1.0/x;
    }
  else
    {
      /* Index of nearest table element.
        Roundoff to integer is asymmetrical to avoid cancellation when t < 0
         (cf. fdlibm). */
      k = 8.0 * x + 0.25;
      u = 0.125 * k;
      /* Small arctan argument.  */
      t = (x - u) / (1.0 + x * u);
    }

  /* Arctan of small argument t.  */
  u = t * t;
  p =     ((((p4 * u) + p3) * u + p2) * u + p1) * u + p0;
  q = ((((u + q4) * u + q3) * u + q2) * u + q1) * u + q0;
  u = t * u * p / q  +  t;

  /* arctan x = arctan u  +  arctan t */
  u = atantbl[k] + u;
  if (sign)
    return (-u);
  else
    return u;
}

Here is the caller graph for this function:

long_double_symbol ( libm  ,
__atanl  ,
atanl   
)

Variable Documentation

const long double atantbl[84] [static]

Definition at line 66 of file s_atanl.c.

const long double p0 = -4.283708356338736809269381409828726405572E1L [static]

Definition at line 159 of file s_atanl.c.

const long double p1 = -8.636132499244548540964557273544599863825E1L [static]

Definition at line 160 of file s_atanl.c.

const long double p2 = -5.713554848244551350855604111031839613216E1L [static]

Definition at line 161 of file s_atanl.c.

const long double p3 = -1.371405711877433266573835355036413750118E1L [static]

Definition at line 162 of file s_atanl.c.

const long double p4 = -8.638214309119210906997318946650189640184E-1L [static]

Definition at line 163 of file s_atanl.c.

const long double q0 = 1.285112506901621042780814422948906537959E2L [static]

Definition at line 164 of file s_atanl.c.

const long double q1 = 3.361907253914337187957855834229672347089E2L [static]

Definition at line 165 of file s_atanl.c.

const long double q2 = 3.180448303864130128268191635189365331680E2L [static]

Definition at line 166 of file s_atanl.c.

const long double q3 = 1.307244136980865800160844625025280344686E2L [static]

Definition at line 167 of file s_atanl.c.

const long double q4 = 2.173623741810414221251136181221172551416E1L [static]

Definition at line 168 of file s_atanl.c.