亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? quad_float.cpp

?? NTL is a high-performance, portable C++ library providing data structures and algorithms for manipul
?? CPP
?? 第 1 頁 / 共 2 頁
字號:

  // c = ((((x.hi-U)-u)+x.lo)-C*y.lo)/y.hi;

  c = x.hi-U;
  c = c-u;
  c = c+x.lo;
  t1 = C*y.lo;
  c = c - t1;
  c = c/y.hi;
  
  hy = C+c;
  ty = C-hy;
  ty = ty+c;

END_FIX
  return quad_float(hy, ty);
}

quad_float& operator /=(quad_float& x, const quad_float& y ) {
START_FIX
  DOUBLE hc, tc, hy, ty, C, c, U, u;
  DOUBLE t1;

  C = x.hi/y.hi;
  c = NTL_QUAD_FLOAT_SPLIT*C;
  hc = c-C;
  u = NTL_QUAD_FLOAT_SPLIT*y.hi;
  hc = c-hc;
  tc = C-hc;
  hy = u-y.hi;
  U = C * y.hi;
  hy = u-hy;
  ty = y.hi-hy;

  // u = (((hc*hy-U)+hc*ty)+tc*hy)+tc*ty;

  u = hc*hy;
  u = u-U;
  t1 = hc*ty;
  u = u+t1;
  t1 = tc*hy;
  u = u+t1;
  t1 = tc*ty;
  u = u+t1;

  // c = ((((x.hi-U)-u)+x.lo)-C*y.lo)/y.hi;

  c = x.hi-U;
  c = c-u;
  c = c+x.lo;
  t1 = C*y.lo;
  c = c - t1;
  c = c/y.hi;
  
  hy = C+c;
  ty = C-hy;
  ty = ty+c;

  x.hi = hy;
  x.lo = ty;
END_FIX
  return x;
}


quad_float sqrt(const quad_float& y) {
  if (y.hi < 0.0) 
    Error("Quad: attempto to take square root of negative number");
  if (y.hi == 0.0) return quad_float(0.0,0.0);

  double c;
  c = sqrt(y.hi);
  ForceToMem(&c);  // This is fairly paranoid, but it doesn't cost too much.

START_FIX

  DOUBLE p,q,hx,tx,u,uu,cc;
  DOUBLE t1;

  p = NTL_QUAD_FLOAT_SPLIT*c; 
  hx = (c-p); 
  hx = hx+p; 
  tx = c-hx;
  p = hx*hx;
  q = hx*tx;
  q = q+q;

  u = p+q;
  uu = p-u;
  uu = uu+q;
  t1 = tx*tx;
  uu = uu+t1;


  cc = y.hi-u;
  cc = cc-uu;
  cc = cc+y.lo;
  t1 = c+c;
  cc = cc/t1;

  hx = c+cc;
  tx = c-hx;
  tx = tx+cc;
END_FIX
  return quad_float(hx, tx);
}



void power(quad_float& z, const quad_float& a, long e)
{
   quad_float res, u;
   unsigned long k;

   if (e < 0)
      k = -((unsigned long) e);
   else
      k = e;

   res = 1.0;
   u = a;

   while (k) {
      if (k & 1)
         res = res * u;

      k = k >> 1;
      if (k)
         u = u * u;
   }

   if (e < 0)
      z = 1.0/res;
   else
      z = res;
}


void power2(quad_float& z, long e)
{
   z.hi = _ntl_ldexp(1.0, e);
   z.lo = 0;
}


long to_long(const quad_float& x)
{
   double fhi, flo;

   fhi = floor(x.hi);

   if (fhi == x.hi) 
      flo = floor(x.lo);
   else
      flo = 0;

   // the following code helps to prevent unnecessary integer overflow,
   // and guarantees that to_long(to_quad_float(a)) == a, for all long a,
   // provided long's are not too wide.

   if (fhi > 0)
      return long(flo) - long(-fhi);
   else
      return long(fhi) + long(flo);
}



// This version of ZZ to quad_float coversion relies on the
// precise rounding rules implemented by the ZZ to double conversion.


void conv(quad_float& z, const ZZ& a)
{
   double xhi, xlo;

   conv(xhi, a);

   if (!IsFinite(&xhi)) {
      z.hi = xhi;
      z.lo = 0;
      return;
   }

   static ZZ t;

   conv(t, xhi);
   sub(t, a, t);

   conv(xlo, t);

   normalize(z, xhi, xlo);

   // The following is just paranoia.
   if (fabs(z.hi) < NTL_FDOUBLE_PRECISION && z.lo != 0)
      Error("internal error: ZZ to quad_float conversion");
} 

void conv(ZZ& z, const quad_float& x)
{ 
   static ZZ t1, t2, t3;

   double fhi, flo;

   fhi = floor(x.hi);

   if (fhi == x.hi) {
      flo = floor(x.lo);

      conv(t1, fhi);
      conv(t2, flo);

      add(z, t1, t2);
   }
   else
      conv(z, fhi);
}



ostream& operator<<(ostream& s, const quad_float& a)
{
   quad_float aa = a;

   if (!IsFinite(&aa)) {
      s << "NaN";
      return s;
   }

   long old_p = RR::precision();
   long old_op = RR::OutputPrecision();

   RR::SetPrecision(long(3.33*quad_float::oprec) + 10);
   RR::SetOutputPrecision(quad_float::oprec);

   static RR t;

   conv(t, a);
   s << t;

   RR::SetPrecision(old_p);
   RR::SetOutputPrecision(old_op);

   return s;
}

istream& operator>>(istream& s, quad_float& x)
{
   long old_p = RR::precision();
   RR::SetPrecision(4*NTL_DOUBLE_PRECISION);

   static RR t;
   s >> t;
   conv(x, t);

   RR::SetPrecision(old_p);
   return s;
}

void random(quad_float& x)
{
   long old_p = RR::precision();
   RR::SetPrecision(4*NTL_DOUBLE_PRECISION);

   static RR t;
   random(t);
   conv(x, t);

   RR::SetPrecision(old_p);
}

quad_float random_quad_float()
{
   quad_float x;
   random(x);
   return x;
}
      
long IsFinite(quad_float *x)
{
   return IsFinite(&x->hi) && IsFinite(&x->lo);
}


long PrecisionOK()
{
START_FIX
   long k;
   DOUBLE l1 = (double)1;
   DOUBLE lh = 1/(double)2;
   DOUBLE epsilon;
   DOUBLE fudge, oldfudge;

   epsilon = l1;
   fudge = l1+l1;

   k = 0;

   do {
      k++;
      epsilon = epsilon * lh;
      oldfudge = fudge;
      fudge = l1 + epsilon;
   } while (fudge > l1 && fudge < oldfudge);

END_FIX
   return k == NTL_DOUBLE_PRECISION;
}

quad_float floor(const quad_float& x)
{
   double fhi = floor(x.hi);

   if (fhi != x.hi)
      return quad_float(fhi, 0.0);
   else {
      double flo = floor(x.lo);
      quad_float z;
      normalize(z, fhi, flo);
      return z;
   }
}


quad_float ceil(const quad_float& x) { 
  return -floor(-x);
}

quad_float trunc(const quad_float& x) { 
  if (x>=0.0) return floor(x); else return -floor(-x);
}



long compare(const quad_float& x, const quad_float& y)
{
   if (x.hi > y.hi) 
      return 1;
   else if (x.hi < y.hi)
      return -1;
   else if (x.lo > y.lo)
      return 1;
   else if (x.lo < y.lo) 
      return -1;
   else
      return 0;
}


quad_float fabs(const quad_float& x) 
{ if (x.hi>=0.0) return x; else return -x; }

quad_float to_quad_float(const char *s)
{
   quad_float x;
   long old_p = RR::precision();
   RR::SetPrecision(4*NTL_DOUBLE_PRECISION);

   static RR t;
   conv(t, s);
   conv(x, t);

   RR::SetPrecision(old_p);
   return x;
}


quad_float ldexp(const quad_float& x, long exp) { // x*2^exp
   double xhi, xlo;
   quad_float z;

   xhi = _ntl_ldexp(x.hi, exp);
   xlo = _ntl_ldexp(x.lo, exp);

   normalize(z, xhi, xlo);
   return z;
}


quad_float exp(const quad_float& x) { // New version 97 Aug 05
/*
!  Calculate a quadruple-precision exponential
!  Method:
!   x    x.log2(e)    nint[x.log2(e)] + frac[x.log2(e)]
!  e  = 2          = 2
!
!                     iy    fy
!                  = 2   . 2
!  Then
!   fy    y.loge(2)
!  2   = e
!
!  Now y.loge(2) will be less than 0.3466 in absolute value.
!  This is halved and a Pade aproximation is used to approximate e^x over
!  the region (-0.1733, +0.1733).   This approximation is then squared.
*/
  if (x.hi<DBL_MIN_10_EXP*2.302585092994045684017991) 
    return to_quad_float(0.0);
  if (x.hi>DBL_MAX_10_EXP*2.302585092994045684017991) {
    Error("exp(quad_float): overflow");
  }

  // changed this from "const" to "static" in v5.3, since "const"
  // causes the initialization to be performed with *every* invocation.
  static quad_float Log2 = 
    to_quad_float("0.6931471805599453094172321214581765680755");

  quad_float y,temp,ysq,sum1,sum2;
  long iy;
  y=x/Log2;
  temp = floor(y+0.5);
  iy = to_long(temp);
  y=(y-temp)*Log2;
  y=ldexp(y,-1L);
  ysq=y*y;
  sum1=y*((((ysq+3960.0)*ysq+2162160.0)*ysq+302702400.0)*ysq+8821612800.0);
  sum2=(((90.0*ysq+110880.0)*ysq+30270240.0)*ysq+2075673600.0)*ysq+17643225600.0;
/*
!                     sum2 + sum1         2.sum1
! Now approximation = ----------- = 1 + ----------- = 1 + 2.temp
!                     sum2 - sum1       sum2 - sum1
!
! Then (1 + 2.temp)^2 = 4.temp.(1 + temp) + 1
*/
  temp=sum1/(sum2-sum1);
  y=temp*(temp+1);
  y=ldexp(y,2L);
  return ldexp(y+1,iy);
}

quad_float log(const quad_float& t) { // Newton method. See Bailey, MPFUN
  if (t.hi <= 0.0) {
    Error("log(quad_float): argument must be positive");
  }
  double s1 = log(t.hi);
  ForceToMem(&s1);  // Again, this is fairly paranoid.
  quad_float s;
  s = s1;
  quad_float e;
  e=exp(s);
  return s+(t-e)/e;  // Newton step
}

long operator> (const quad_float& x, const quad_float& y) {
   return (x.hi> y.hi) || (x.hi==y.hi && x.lo> y.lo); }
long operator>=(const quad_float& x, const quad_float& y) {
   return (x.hi>y.hi) || (x.hi==y.hi && x.lo>=y.lo); }
long operator< (const quad_float& x, const quad_float& y) {
   return (x.hi< y.hi) || (x.hi==y.hi && x.lo< y.lo); }
long operator<=(const quad_float& x, const quad_float& y) {
   return (x.hi<y.hi) || (x.hi==y.hi && x.lo<=y.lo); }
long operator==(const quad_float& x, const quad_float& y)
   { return x.hi==y.hi && x.lo==y.lo; }
long operator!=(const quad_float& x, const quad_float& y)
   { return x.hi!=y.hi || x.lo!=y.lo; }


NTL_END_IMPL

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲18色成人| 亚洲国产精品视频| 国产九九视频一区二区三区| 欧美群妇大交群中文字幕| 日韩电影在线一区| 日韩免费观看高清完整版在线观看| 青草av.久久免费一区| 精品毛片乱码1区2区3区| 国产精品亚洲第一| 亚洲视频图片小说| 欧美理论在线播放| 国内精品伊人久久久久影院对白| 久久久久国产精品麻豆| 一本色道**综合亚洲精品蜜桃冫| 伊人色综合久久天天人手人婷| 欧美电影一区二区| 国产精一区二区三区| 自拍视频在线观看一区二区| 欧美日韩一区 二区 三区 久久精品 | 精品日韩一区二区| 从欧美一区二区三区| 亚洲美腿欧美偷拍| 日韩欧美资源站| 成人福利电影精品一区二区在线观看 | 久久国产精品99精品国产| 欧美激情中文字幕一区二区| 色哟哟国产精品| 国产一区二区三区免费在线观看| 亚洲欧美一区二区在线观看| 日韩欧美视频在线| 91网站在线播放| 麻豆国产欧美一区二区三区| 亚洲男人都懂的| 精品成人在线观看| 欧美日韩一区二区电影| 成人h精品动漫一区二区三区| 婷婷中文字幕综合| 成人免费在线观看入口| 2024国产精品| 欧美日韩精品一区视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产欧美日韩视频在线观看| 欧美日韩综合在线免费观看| 国产精品亚洲а∨天堂免在线| 亚洲高清在线视频| 中国av一区二区三区| 欧美大白屁股肥臀xxxxxx| 色成年激情久久综合| 国产69精品久久久久毛片| 午夜精品福利在线| 日韩伦理av电影| 国产精品三级电影| www国产成人| 欧美v亚洲v综合ⅴ国产v| 欧美色手机在线观看| 日本精品视频一区二区| 97精品久久久久中文字幕| 国产黄色91视频| 国产在线看一区| 久久精品久久99精品久久| 日韩电影网1区2区| 日韩av电影天堂| 午夜精品久久久久久久蜜桃app| 国产精品动漫网站| 国产精品网站在线| 欧美激情一区在线| 国产精品免费丝袜| 国产精品久久综合| 中文字幕视频一区| 亚洲欧美在线另类| 亚洲狠狠丁香婷婷综合久久久| 亚洲欧洲精品成人久久奇米网| 国产精品素人一区二区| 欧美经典三级视频一区二区三区| 久久久国产精品麻豆| 国产亚洲欧美日韩在线一区| 国产欧美一区二区三区网站| 国产视频一区二区在线观看| 久久品道一品道久久精品| 久久婷婷成人综合色| 久久综合久久久久88| www久久久久| 中文一区在线播放| 国产精品乱码人人做人人爱| 国产精品伦一区| 一区二区三区在线观看网站| 亚洲线精品一区二区三区| 偷窥国产亚洲免费视频| 青青草原综合久久大伊人精品 | 午夜视频久久久久久| 日本视频在线一区| 国产一区二区三区最好精华液| 国产一区二区三区在线观看精品 | 精品亚洲国产成人av制服丝袜| 久久99国产精品免费| 成人免费视频视频| 91婷婷韩国欧美一区二区| 欧美日韩国产高清一区| 欧美一级黄色大片| 国产精品视频一二三区| 亚洲一区二区三区美女| 日本特黄久久久高潮| 成人深夜视频在线观看| 欧美写真视频网站| 精品日韩在线观看| 亚洲区小说区图片区qvod| 日本中文一区二区三区| 国产乱一区二区| 91极品美女在线| 久久免费电影网| 亚洲激情成人在线| 国产麻豆成人精品| 91看片淫黄大片一级| 日韩一卡二卡三卡国产欧美| 国产精品久久毛片a| 天天操天天色综合| 成人avav在线| 日韩精品一区国产麻豆| 最新不卡av在线| 久久99热狠狠色一区二区| 9l国产精品久久久久麻豆| 欧美一区二区三区白人| 中文字幕一区二区三区不卡在线 | 国产a视频精品免费观看| 欧美在线小视频| 国产日产欧美一区二区三区| 一区二区三区日韩精品视频| 九九**精品视频免费播放| 91成人在线免费观看| 国产亚洲欧美在线| 日韩国产精品久久久| 91丨porny丨户外露出| 精品久久久久久久人人人人传媒| 亚洲精品美腿丝袜| 国产91露脸合集magnet| 91精品麻豆日日躁夜夜躁| 日韩伦理av电影| 丰满白嫩尤物一区二区| 日韩欧美精品在线视频| 午夜影院久久久| 91丨国产丨九色丨pron| 国产精品网曝门| 国产一区 二区 三区一级| 欧美一区二区三区成人| 亚洲不卡av一区二区三区| 色94色欧美sute亚洲13| 中文字幕一区二区三区视频| 国产福利一区二区三区| 欧美哺乳videos| 首页欧美精品中文字幕| 欧美三级午夜理伦三级中视频| 自拍偷拍欧美激情| 成人av在线一区二区| 欧美国产日本韩| 国产激情视频一区二区三区欧美 | 人妖欧美一区二区| 欧美猛男男办公室激情| 亚洲一二三区视频在线观看| 欧美中文字幕一二三区视频| 亚洲黄色尤物视频| 色婷婷综合久色| 亚洲免费观看高清完整版在线观看熊 | 精品国产麻豆免费人成网站| 人妖欧美一区二区| 日韩限制级电影在线观看| 麻豆精品在线观看| 日韩精品中文字幕在线不卡尤物| 免费亚洲电影在线| 精品电影一区二区三区| 国产一区二区在线影院| 日本一区二区综合亚洲| 成人视屏免费看| 亚洲码国产岛国毛片在线| 色综合天天综合在线视频| 亚洲最新在线观看| 欧美巨大另类极品videosbest| 日本不卡一区二区三区高清视频| 精品剧情在线观看| 国产成人免费高清| 亚洲视频在线观看一区| 精品视频一区二区三区免费| 日韩avvvv在线播放| 精品国内二区三区| 成人av午夜电影| 亚洲乱码国产乱码精品精的特点| 在线免费观看不卡av| 香蕉久久夜色精品国产使用方法| 日韩你懂的电影在线观看| 国产精品一区久久久久| 国产精品久久久久久一区二区三区| 99国产精品国产精品毛片| 亚洲在线观看免费| 精品国产乱子伦一区| 99久久99久久精品国产片果冻| 亚洲午夜久久久久久久久电影网| 日韩欧美一区二区久久婷婷| 国产91对白在线观看九色| 亚洲午夜精品网| 久久精品亚洲国产奇米99| 91色.com|