Print this page




  60  *              101  (z+1-y)/4  -cospi(t)    -sinpi(t)    1/tanpi(t)
  61  *              110  (y-z)/4    -cospi(t)     sinpi(t)   -1/tanpi(t)
  62  *              111  (z+1-y)/4  -sinpi(t)     cospi(t)   -tanpi(t)
  63  *             ---------------------------------------------------
  64  *
  65  * NOTE. This program compute sinpi/cospi(t<0.25) by __k_sin/cos(pi*t, 0.0).
  66  * This will return a result with error slightly more than one ulp (but less
  67  * than 2 ulp). If one wants accurate result,  one may break up pi*t in
  68  * high (tpi_h) and low (tpi_l) parts and call __k_sin/cos(tip_h, tip_lo)
  69  * instead.
  70  */
  71 
  72 #include "libm.h"
  73 #include "libm_synonyms.h"
  74 #include "longdouble.h"
  75 
  76 #include <sys/isa_defs.h>
  77 
  78 #define I(q, m) ((int *) &(q))[m]
  79 #define U(q, m) ((unsigned *) &(q))[m]
  80 #if defined(_LITTLE_ENDIAN)
  81 #define LDBL_MOST_SIGNIF_I(ld)  ((I(ld, 2) << 16) | (0xffff & (I(ld, 1) >> 15)))
  82 #define LDBL_LEAST_SIGNIF_U(ld) U(ld, 0)
  83 #define PREC    64
  84 #define PRECM1  63
  85 #define PRECM2  62
  86 static const long double twoPRECM2 = 9.223372036854775808000000000000000e+18L;
  87 #else
  88 #define LDBL_MOST_SIGNIF_I(ld)  I(ld, 0)
  89 #define LDBL_LEAST_SIGNIF_U(ld) U(ld, sizeof(long double) / sizeof(int) - 1)
  90 #define PREC    113
  91 #define PRECM1  112
  92 #define PRECM2  111
  93 static const long double twoPRECM2 = 5.192296858534827628530496329220096e+33L;
  94 #endif
  95 
  96 static const long double
  97 zero    = 0.0L,
  98 quater  = 0.25L,
  99 one     = 1.0L,
 100 pi      = 3.141592653589793238462643383279502884197e+0000L,




  60  *              101  (z+1-y)/4  -cospi(t)    -sinpi(t)    1/tanpi(t)
  61  *              110  (y-z)/4    -cospi(t)     sinpi(t)   -1/tanpi(t)
  62  *              111  (z+1-y)/4  -sinpi(t)     cospi(t)   -tanpi(t)
  63  *             ---------------------------------------------------
  64  *
  65  * NOTE. This program compute sinpi/cospi(t<0.25) by __k_sin/cos(pi*t, 0.0).
  66  * This will return a result with error slightly more than one ulp (but less
  67  * than 2 ulp). If one wants accurate result,  one may break up pi*t in
  68  * high (tpi_h) and low (tpi_l) parts and call __k_sin/cos(tip_h, tip_lo)
  69  * instead.
  70  */
  71 
  72 #include "libm.h"
  73 #include "libm_synonyms.h"
  74 #include "longdouble.h"
  75 
  76 #include <sys/isa_defs.h>
  77 
  78 #define I(q, m) ((int *) &(q))[m]
  79 #define U(q, m) ((unsigned *) &(q))[m]
  80 #if defined(__i386) || defined(__amd64)
  81 #define LDBL_MOST_SIGNIF_I(ld)  ((I(ld, 2) << 16) | (0xffff & (I(ld, 1) >> 15)))
  82 #define LDBL_LEAST_SIGNIF_U(ld) U(ld, 0)
  83 #define PREC    64
  84 #define PRECM1  63
  85 #define PRECM2  62
  86 static const long double twoPRECM2 = 9.223372036854775808000000000000000e+18L;
  87 #else
  88 #define LDBL_MOST_SIGNIF_I(ld)  I(ld, 0)
  89 #define LDBL_LEAST_SIGNIF_U(ld) U(ld, sizeof(long double) / sizeof(int) - 1)
  90 #define PREC    113
  91 #define PRECM1  112
  92 #define PRECM2  111
  93 static const long double twoPRECM2 = 5.192296858534827628530496329220096e+33L;
  94 #endif
  95 
  96 static const long double
  97 zero    = 0.0L,
  98 quater  = 0.25L,
  99 one     = 1.0L,
 100 pi      = 3.141592653589793238462643383279502884197e+0000L,