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

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

?? quad_float.cpp

?? NTL is a high-performance, portable C++ library providing data structures and algorithms for manipul
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*
Copyright (C) 1997, 1998, 1999, 2000 Victor Shoup

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*****************************************************

The quad_float package is derived from the doubledouble package of
Keith Briggs.  However, the version employed in NTL has been extensively 
modified.  Below, I attach the copyright notice from the original
doubledouble package, which is currently available at 

   http://www.labs.bt.com/people/briggsk2

*****************************************************

Copyright (C) 1997 Keith Martin Briggs

Except where otherwise indicated,
this program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#include <NTL/quad_float.h>
#include <NTL/RR.h>

#include <float.h>

#include <NTL/new.h>

NTL_START_IMPL

#if (defined(__GNUC__) && NTL_EXT_DOUBLE && (defined(__i386__) || defined(__i486__) || defined(__i586__)))

#if (!defined(NTL_X86_FIX) && !defined(NTL_NO_X86_FIX))

#define NTL_X86_FIX

#endif

#endif


#if (NTL_EXT_DOUBLE && !defined(NTL_X86_FIX))

#define DOUBLE volatile double

#else

#define DOUBLE double

#endif


#ifdef NTL_X86_FIX


#define START_FIX \
  volatile unsigned short __old_cw, __new_cw; \
  asm volatile ("fnstcw %0":"=m" (__old_cw)); \
  __new_cw = (__old_cw & ~0x300) | 0x200; \
  asm volatile ("fldcw %0": :"m" (__new_cw));


#define END_FIX  asm volatile ("fldcw %0": :"m" (__old_cw));

#else

#define START_FIX
#define END_FIX

#endif


static 
void normalize(quad_float& z, const double& xhi, const double& xlo)
{
START_FIX
   DOUBLE u, v;

   u = xhi + xlo; 
   v = xhi - u;    
   v = v + xlo;    

   z.hi = u;
   z.lo = v;
END_FIX
}



#if (NTL_BITS_PER_LONG >= NTL_DOUBLE_PRECISION)
quad_float to_quad_float(long n)
{
START_FIX
   DOUBLE xhi, xlo;
   DOUBLE u, v;

   xhi = double(n);

   // Because we are assuming 2's compliment integer
   // arithmetic, the following prevents long(xhi) from overflowing.

   if (n > 0)
      xlo = double(n+long(-xhi));
   else
      xlo = double(n-long(xhi));

   // renormalize...just to be safe
  
   u = xhi + xlo;
   v = xhi - u;
   v = v + xlo;
END_FIX
   return quad_float(u, v);
}

quad_float to_quad_float(unsigned long n)
{
START_FIX
   DOUBLE xhi, xlo, t;
   DOUBLE u, v;

   const double bnd = double(1L << (NTL_BITS_PER_LONG-2))*4.0;

   xhi = double(n);
   
   if (xhi >= bnd)
      t = xhi - bnd;
   else
      t = xhi;

   // we use the "to_long" function here to be as portable as possible.
   long llo = to_long(n - (unsigned long)(t));
   xlo = double(llo);

   // renormalize...just to be safe

   u = xhi + xlo;
   v = xhi - u;
   v = v + xlo;
END_FIX
   return quad_float(u, v);
}
#endif


long quad_float::oprec = 10;

void quad_float::SetOutputPrecision(long p)
{
   if (p < 1) p = 1;

   if (NTL_OVERFLOW(p, 1, 0)) 
      Error("quad_float: output precision too big");

   oprec = p;
}


quad_float operator +(const quad_float& x, const quad_float& y ) {
START_FIX
        DOUBLE    H, h, T, t, S, s, e, f;
        DOUBLE    t1;

        S = x.hi + y.hi;
        T = x.lo + y.lo;
        e = S - x.hi;
        f = T - x.lo;

        t1 = S-e;
        t1 = x.hi-t1;
        s = y.hi-e;
        s = s + t1;
        
        t1 = T-f;
        t1 = x.lo-t1;
        t = y.lo-f;
        t = t + t1;


        s = s + T;
        H = S + s;
        h = S - H;
        h = h + s;

        h = h + t;
        e = H + h; 
        f = H - e;
        f = f + h;
END_FIX
        return quad_float(e, f);
}

quad_float& operator +=(quad_float& x, const quad_float& y ) {
START_FIX
        DOUBLE    H, h, T, t, S, s, e, f;
        DOUBLE    t1;

        S = x.hi + y.hi;
        T = x.lo + y.lo;
        e = S - x.hi;
        f = T - x.lo;

        t1 = S-e;
        t1 = x.hi-t1;
        s = y.hi-e;
        s = s + t1;
        
        t1 = T-f;
        t1 = x.lo-t1;
        t = y.lo-f;
        t = t + t1;


        s = s + T;
        H = S + s;
        h = S - H;
        h = h + s;

        h = h + t;
        e = H + h; 
        f = H - e;
        f = f + h;

        x.hi = e;
        x.lo = f;
END_FIX
        return x;
}

quad_float operator -(const quad_float& x, const quad_float& y ) {
START_FIX
        DOUBLE    H, h, T, t, S, s, e, f;
        DOUBLE    t1, yhi, ylo;

        yhi = -y.hi;
        ylo = -y.lo;

        S = x.hi + yhi;
        T = x.lo + ylo;
        e = S - x.hi;
        f = T - x.lo;

        t1 = S-e;
        t1 = x.hi-t1;
        s = yhi-e;
        s = s + t1;
        
        t1 = T-f;
        t1 = x.lo-t1;
        t = ylo-f;
        t = t + t1;


        s = s + T;
        H = S + s;
        h = S - H;
        h = h + s;

        h = h + t;
        e = H + h; 
        f = H - e;
        f = f + h;

END_FIX
        return quad_float(e, f);
}

quad_float& operator -=(quad_float& x, const quad_float& y ) {
START_FIX
	DOUBLE    H, h, T, t, S, s, e, f;
        DOUBLE    t1, yhi, ylo;

        yhi = -y.hi;
        ylo = -y.lo;

        S = x.hi + yhi;
        T = x.lo + ylo;
        e = S - x.hi;
        f = T - x.lo;

        t1 = S-e;
        t1 = x.hi-t1;
        s = yhi-e;
        s = s + t1;
        
        t1 = T-f;
        t1 = x.lo-t1;
        t = ylo-f;
        t = t + t1;


        s = s + T;
        H = S + s;
        h = S - H;
        h = h + s;

        h = h + t;
        e = H + h; 
        f = H - e;
        f = f + h;

        x.hi = e;
        x.lo = f;
END_FIX
        return x;
}

quad_float operator -(const quad_float& x)
{
START_FIX
   DOUBLE xhi, xlo, u, v;

   xhi = -x.hi;
   xlo = -x.lo;

   // it is a good idea to renormalize here, just in case
   // the rounding rule depends on sign, and thus we will
   // maintain the "normal form" for quad_float's.
  
   u = xhi + xlo;
   v = xhi - u;
   v = v + xlo;

END_FIX
   return quad_float(u, v);
}


quad_float operator *(const quad_float& x,const quad_float& y ) {
START_FIX
  DOUBLE hx, tx, hy, ty, C, c;
  DOUBLE t1, t2;

  C = NTL_QUAD_FLOAT_SPLIT*x.hi;
  hx = C-x.hi;
  c = NTL_QUAD_FLOAT_SPLIT*y.hi;
  hx = C-hx;
  tx = x.hi-hx;
  hy = c-y.hi;
  C = x.hi*y.hi;
  hy = c-hy;
  ty = y.hi-hy;

  // c = ((((hx*hy-C)+hx*ty)+tx*hy)+tx*ty)+(x.hi*y.lo+x.lo*y.hi);
  
  t1 = hx*hy;
  t1 = t1-C;
  t2 = hx*ty;
  t1 = t1+t2;
  t2 = tx*hy;
  t1 = t1+t2;
  t2 = tx*ty;
  c = t1+t2;
  t1 = x.hi*y.lo;
  t2 = x.lo*y.hi;
  t1 = t1+t2;
  c = c + t1;


  hx = C+c;
  tx = C-hx;
  tx = tx+c;

END_FIX
  return quad_float(hx, tx);
}

quad_float& operator *=(quad_float& x,const quad_float& y ) {
START_FIX
  DOUBLE hx, tx, hy, ty, C, c;
  DOUBLE t1, t2;

  C = NTL_QUAD_FLOAT_SPLIT*x.hi;
  hx = C-x.hi;
  c = NTL_QUAD_FLOAT_SPLIT*y.hi;
  hx = C-hx;
  tx = x.hi-hx;
  hy = c-y.hi;
  C = x.hi*y.hi;
  hy = c-hy;
  ty = y.hi-hy;

  // c = ((((hx*hy-C)+hx*ty)+tx*hy)+tx*ty)+(x.hi*y.lo+x.lo*y.hi);
  
  t1 = hx*hy;
  t1 = t1-C;
  t2 = hx*ty;
  t1 = t1+t2;
  t2 = tx*hy;
  t1 = t1+t2;
  t2 = tx*ty;
  c = t1+t2;
  t1 = x.hi*y.lo;
  t2 = x.lo*y.hi;
  t1 = t1+t2;
  c = c + t1;


  hx = C+c;
  tx = C-hx;
  tx = tx+c;

  x.hi = hx;
  x.lo = tx;
END_FIX
  return x;
}

quad_float operator /(const 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女脱光内衣内裤视频久久影院| 在线成人av网站| 亚洲一区二区三区美女| 久久综合久久99| 欧美日韩综合在线| 波多野结衣一区二区三区| 日本不卡高清视频| 一区二区三区在线观看网站| 精品久久久久久无| 欧美日韩美少妇| www.欧美色图| 国产盗摄女厕一区二区三区| 日本不卡一区二区三区 | 日韩精品在线网站| 在线观看免费成人| www.亚洲免费av| 国产精品1区2区3区在线观看| 日韩中文字幕91| 伊人色综合久久天天| 国产精品久久久久久久午夜片 | 欧美一级欧美三级| 欧日韩精品视频| 91丨九色丨黑人外教| 成人激情小说网站| 国产大陆亚洲精品国产| 国产一区二区不卡老阿姨| 蜜桃免费网站一区二区三区| 亚洲成人av资源| 亚洲a一区二区| 亚洲国产日韩精品| 亚洲国产日韩精品| 亚洲一区欧美一区| 亚洲不卡在线观看| 日韩精品电影在线观看| 午夜av一区二区三区| 一区二区久久久久久| 亚洲图片欧美色图| 肉肉av福利一精品导航| 午夜私人影院久久久久| 日韩在线卡一卡二| 日本不卡的三区四区五区| 人禽交欧美网站| 裸体在线国模精品偷拍| 久久超碰97中文字幕| 精彩视频一区二区| 国产麻豆视频精品| 成人网男人的天堂| 色综合久久综合网97色综合| 91高清视频免费看| 欧美久久久久久蜜桃| 3d动漫精品啪啪1区2区免费| 欧美一区二区三区视频在线观看| 日韩欧美你懂的| 欧美激情资源网| 亚洲女人小视频在线观看| 亚洲国产精品视频| 麻豆视频一区二区| 成人午夜激情片| 在线免费观看成人短视频| 欧美二区三区的天堂| 精品国产精品网麻豆系列| 中日韩av电影| 亚洲一二三四在线观看| 蜜桃在线一区二区三区| 国产精品一级片在线观看| 99久久免费国产| 欧美日韩精品是欧美日韩精品| 欧美一级二级三级乱码| 久久久久国产免费免费| 亚洲乱码国产乱码精品精98午夜 | 日韩欧美亚洲一区二区| 国产色91在线| 一区二区三区蜜桃网| 免费av网站大全久久| 国产成人a级片| 日本高清不卡视频| 久久影院视频免费| 亚洲人成人一区二区在线观看| 人人爽香蕉精品| av福利精品导航| 日韩午夜激情av| 中文字幕永久在线不卡| 婷婷久久综合九色国产成人| 国产成人h网站| 91精品国产综合久久香蕉麻豆| 久久精品视频在线免费观看 | 日韩高清不卡一区二区三区| 国产高清成人在线| 欧美欧美欧美欧美| 中文字幕av在线一区二区三区| 亚洲高清在线精品| 北岛玲一区二区三区四区| 欧美tk—视频vk| 午夜在线成人av| 91麻豆精品秘密| 欧美国产丝袜视频| 捆绑紧缚一区二区三区视频| 91麻豆精品一区二区三区| 久久久午夜精品理论片中文字幕| 亚洲成av人影院在线观看网| 成人午夜电影网站| 欧美一二三在线| 亚洲国产一区二区三区| 成人成人成人在线视频| 欧美精品一区二区在线观看| 午夜成人免费电影| 91福利在线免费观看| 国产精品麻豆欧美日韩ww| 国产综合久久久久久久久久久久| 欧美日韩aaaaa| 一区二区三区日本| av毛片久久久久**hd| 国产日韩亚洲欧美综合| 黑人巨大精品欧美黑白配亚洲| 51久久夜色精品国产麻豆| 一区二区三区在线高清| av电影在线观看一区| 国产精品午夜免费| 国产精品白丝av| 久久婷婷色综合| 久久精品国产精品亚洲精品| 欧美一卡二卡在线观看| 丝袜a∨在线一区二区三区不卡| 色综合久久88色综合天天| 国产精品欧美一区二区三区| 丁香亚洲综合激情啪啪综合| www亚洲一区| 国产一区二区免费在线| 久久久av毛片精品| 国产精品一区二区在线观看不卡| 精品日韩一区二区| 精品一区二区在线视频| 精品国产网站在线观看| 精品综合免费视频观看| 日韩欧美一区在线观看| 麻豆一区二区99久久久久| 精品久久久久久亚洲综合网| 韩国av一区二区三区四区| 欧美精品一区二区在线播放| 黑人巨大精品欧美黑白配亚洲| 精品99久久久久久| 精品一区二区三区蜜桃| 久久在线观看免费| 成人高清免费在线播放| 国产精品国产自产拍高清av王其| 成人av高清在线| 亚洲欧美日韩综合aⅴ视频| 欧洲中文字幕精品| 日韩不卡一区二区| 精品盗摄一区二区三区| 粉嫩aⅴ一区二区三区四区五区| 国产精品白丝在线| 欧美日韩一级视频| 另类调教123区| 国产女人18水真多18精品一级做| 99精品视频中文字幕| 一区二区三区四区蜜桃| 欧美精品一二三| 精品一区二区三区久久久| 国产精品久久99| 在线成人免费视频| 国产精品911| 亚洲一区二区欧美日韩| 欧美不卡视频一区| 播五月开心婷婷综合| 亚洲一区二区三区四区在线免费观看 | 一区二区在线观看视频在线观看| 欧美日本韩国一区二区三区视频 | 在线播放91灌醉迷j高跟美女| 美腿丝袜在线亚洲一区| 国产精品丝袜久久久久久app| 欧日韩精品视频| 国产美女娇喘av呻吟久久 | 国产伦精品一区二区三区免费迷 | 久久久久久久性| 色吧成人激情小说| 麻豆成人在线观看| 亚洲色图.com| 久久久蜜桃精品| 欧美日韩在线播放三区| 国产美女在线精品| 亚洲aaa精品| 中文字幕亚洲不卡| 日韩一区二区免费电影| 91丨porny丨在线| 国产一区欧美日韩| 亚洲国产一区二区三区青草影视 | 日韩中文字幕区一区有砖一区| 久久精品一区四区| 制服丝袜亚洲播放| 91免费精品国自产拍在线不卡| 久久精品久久99精品久久| 夜夜爽夜夜爽精品视频| 久久久久久99久久久精品网站| 欧美日韩国产一区| 99re热这里只有精品免费视频| 免费久久99精品国产| 亚洲香肠在线观看| 国产精品另类一区| 精品国产成人系列|