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

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

?? quad_float.txt

?? 密碼大家Shoup寫的數論算法c語言實現
?? TXT
字號:
/**************************************************************************\MODULE: quad_floatSUMMARY:The class quad_float is used to represent quadruple precision numbers.Thus, with standard IEEE floating point, you should get the equivalentof about 106 bits of precision (but actually just a bit less).The interface allows you to treat quad_floats as if they were"ordinary" floating point types.See below for more implementation details.\**************************************************************************/#include <NTL/ZZ.h>class quad_float {public:quad_float(); // = 0quad_float(const quad_float& a);  // copy constructorquad_float& operator=(const quad_float& a);  // assignment operatorquad_float& operator=(double a);~quad_float();static void SetOutputPrecision(long p);// This sets the number of decimal digits to be output.  Default is// 10.static long OutputPrecision();// returns current output precision.};/**************************************************************************\                             Arithmetic Operations\**************************************************************************/quad_float operator +(const quad_float& x, const quad_float& y);quad_float operator -(const quad_float& x, const quad_float& y);quad_float operator *(const quad_float& x, const quad_float& y);quad_float operator /(const quad_float& x, const quad_float& y);// PROMOTIONS: operators +, -, *, / promote double to quad_float// on (x, y).quad_float operator -(const quad_float& x);quad_float& operator += (quad_float& x, const quad_float& y);quad_float& operator += (quad_float& x, double y);quad_float& operator -= (quad_float& x, const quad_float& y);quad_float& operator -= (quad_float& x, double y);quad_float& operator *= (quad_float& x, const quad_float& y);quad_float& operator *= (quad_float& x, double y);quad_float& operator /= (quad_float& x, const quad_float& y);quad_float& operator /= (quad_float& x, double y);quad_float& operator++(quad_float& a); // prefixvoid operator++(quad_float& a, int); // postfixquad_float& operator--(quad_float& a); // prefixvoid operator--(quad_float& a, int); // postfix/**************************************************************************\                                  Comparison\**************************************************************************/long operator> (const quad_float& x, const quad_float& y);long operator>=(const quad_float& x, const quad_float& y);long operator< (const quad_float& x, const quad_float& y);long operator<=(const quad_float& x, const quad_float& y);long operator==(const quad_float& x, const quad_float& y);long operator!=(const quad_float& x, const quad_float& y);long sign(const quad_float& x);  // sign of x, -1, 0, +1long compare(const quad_float& x, const quad_float& y); // sign of x - y// PROMOTIONS: operators >, ..., != and function compare// promote double to quad_float on (x, y)./**************************************************************************\                               Input/OutputInput Syntax:<number>: [ "-" ] <unsigned-number><unsigned-number>: <dotted-number> [ <e-part> ] | <e-part><dotted-number>: <digits> | <digits> "." <digits> | "." <digits> | <digits> "."<digits>: <digit> <digits> | <digit><digit>: "0" | ... | "9"<e-part>: ( "E" | "e" ) [ "+" | "-" ] <digits>Examples of valid input:17 1.5 0.5 .5  5.  -.5 e10 e-10 e+10 1.5e10 .5e10 .5E10Note that the number of decimal digits of precision that are usedfor output can be set to any number p >= 1 by callingthe routine quad_float::SetOutputPrecision(p).  The default value of p is 10.The current value of p is returned by a call to quad_float::OutputPrecision().\**************************************************************************/istream& operator >> (istream& s, quad_float& x);ostream& operator << (ostream& s, const quad_float& x);/**************************************************************************\                                  Miscellaneous\**************************************************************************/quad_float sqrt(const quad_float& x);quad_float floor(const quad_float& x);quad_float ceil(const quad_float& x);quad_float trunc(const quad_float& x);quad_float fabs(const quad_float& x);quad_float exp(const quad_float& x);quad_float log(const quad_float& x);void power(quad_float& x, const quad_float& a, long e); // x = a^equad_float power(const quad_float& a, long e); void power2(quad_float& x, long e); // x = 2^equad_float power2_quad_float(long e); quad_float ldexp(const quad_float& x, long e);  // return x*2^elong IsFinite(quad_float *x); // checks if x is "finite"                                 // pointer is used for compatability with                              // IsFinite(double*)void random(quad_float& x);quad_float random_quad_float();// generate a random quad_float x with 0 <= x <= 1/***********************************************************************\IMPLEMENTATION DETAILSA quad_float x is represented as a pair of doubles, x.hi and x.lo,such that the number represented by x is x.hi + x.lo, where   |x.lo| <= 0.5*ulp(x.hi),  (*)and ulp(y) means "unit in the last place of y".  For the software to work correctly, IEEE Standard Arithmetic is sufficient.  That includes just about every modern computer; the only exception I'maware of is Intel x86 platforms running Linux (but you can stilluse this platform--see below).Also sufficient is any platform that implements arithmetic with correct rounding, i.e., given double floating point numbers a and b, a op b is computed exactly and then rounded to the nearest double.  The tie-breaking rule is not important.This is a rather wierd representation;  although it gives oneessentially twice the precision of an ordinary double, it isnot really the equivalent of quadratic precision (despite the name).For example, the number 1 + 2^{-200} can be represented exactly asa quad_float.  Also, there is no real notion of "machine precision".THE INTEL x86 PROBLEMAlthough just about every modern processor implements the IEEEfloating point standard, there is still can be problemson processors that support IEEE extended double precision.The only processor I know of that supports this is the x86/Pentium.While extended double precision may sound like a nice thing,it is not.  Normal double precision has 53 bits of precision.Extended has 64.  On x86s, the FP registers have 53 or 64 bitsof precision---this can be set at run-time by modifyingthe cpu "control word" (something that can be doneonly in assembly code).However, doubles stored in memory always have only 53 bits.Compilers may move values between memory and registerswhenever they want, which can effectively change the valueof a floating point number even though at the C/C++ level,nothing has happened that should have changed the value.Is that sick, or what?This is a real headache, and if one is not just a bit careful,the quad_float code will break.  This breaking is not at all subtle,and the program QuadTest will catch the problem if it exists.You should not need to worry about any of this, because NTL automaticallydetects and works around these problems as best it can, as described below.It shouldn't make a mistake, but if it does, you willcatch it in the QuadTest program.If things don't work quite right, you might trysetting NTL_FIX_X86 or NTL_NO_FIX_X86 flags in ntl_config.h,but this should not be necessary.Here are the details about how NTL fixes the problem.The first and best way is to have the default setting of the control wordbe 53 bits.  However, you are at the mercy of your platform(compiler, OS, run-time libraries).  Windows does this,and so the problem simply does not arise here, and NTL neitherdetects nor fixes the problem.  Linux, however, does not do this,which really sucks.  Can we talk these Linux people into changing this?The second way to fix the problem is by having NTL fiddle with control word itself.  If you compile NTL using a GNU compileron an x86, this should happen automatically.On the one hand, this is not a general, portable solution,since it will only work if you use a GNU compiler, or at least one thatsupports GNU 'asm' syntax.  On the other hand, almost everybody who compiles C++ on x86/Linuxplatforms uses GNU compilers (although are some commercialcompilers out there that I don't know too much about).The third way to fix the problem is to 'force' all intermediatefloating point results into memory.  This is not an 'ideal' fix,since it is not fully equivalent to 53-bit precision (because of double rounding), but it works (although to be honest, I've never seena full proof of correctness in this case).NTL's quad_float code does this by storing intermediate resultsin local variables declared to be 'volatile'.This is the solution to the problem that NTL uses if it detectsthe problem and can't fix it using the GNU 'asm' hack mentioned above.This solution should work on any platform that faithfullyimplements 'volatile' according to the ANSI C standard.BACKGROUND INFOThe code NTL uses algorithms designed by Knuth, Kahan, Dekker, andLinnainmaa.  The original transcription to C++ was done by DouglasPriest.  Enhancements and bug fixes were done by Keith Briggs(http://epidem13.plantsci.cam.ac.uk/~kbriggs).  The NTL version is astripped down version of Briggs' code, with a couple of bug fixes andportability improvements.  Briggs has continued to develop hislibrary;  see his web page above for the latest version and more information.Here is a brief annotated bibliography (compiled by Priest) of papers dealing with DP and similar techniques, arranged chronologically.Kahan, W., Further Remarks on Reducing Truncation Errors,  {\it Comm.\ ACM\/} {\bf 8} (1965), 40.M{\o}ller, O., Quasi Double Precision in Floating-Point Addition,  {\it BIT\/} {\bf 5} (1965), 37--50.  The two papers that first presented the idea of recovering the  roundoff of a sum.Dekker, T., A Floating-Point Technique for Extending the Available  Precision, {\it Numer.\ Math.} {\bf 18} (1971), 224--242.  The classic reference for DP algorithms for sum, product, quotient,  and square root.Pichat, M., Correction d'une Somme en Arithmetique \`a Virgule  Flottante, {\it Numer.\ Math.} {\bf 19} (1972), 400--406.  An iterative algorithm for computing a protracted sum to working  precision by repeatedly applying the sum-and-roundoff method.Linnainmaa, S., Analysis of Some Known Methods of Improving the Accuracy  of Floating-Point Sums, {\it BIT\/} {\bf 14} (1974), 167--202.  Comparison of Kahan and M{\o}ller algorithms with variations given  by Knuth.Bohlender, G., Floating-Point Computation of Functions with Maximum  Accuracy, {\it IEEE Trans.\ Comput.} {\bf C-26} (1977), 621--632.  Extended the analysis of Pichat's algorithm to compute a multi-word  representation of the exact sum of n working precision numbers.  This is the algorithm Kahan has called "distillation".Linnainmaa, S., Software for Doubled-Precision Floating-Point Computations,  {\it ACM Trans.\ Math.\ Soft.} {\bf 7} (1981), 272--283.  Generalized the hypotheses of Dekker and showed how to take advantage  of extended precision where available.Leuprecht, H., and W.~Oberaigner, Parallel Algorithms for the Rounding-Exact  Summation of Floating-Point Numbers, {\it Computing} {\bf 28} (1982), 89--104.  Variations of distillation appropriate for parallel and vector  architectures.Kahan, W., Paradoxes in Concepts of Accuracy, lecture notes from Joint  Seminar on Issues and Directions in Scientific Computation, Berkeley, 1989.  Gives the more accurate DP sum I've shown above, discusses some  examples.Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic,  in P.~Kornerup and D.~Matula, Eds., {\it Proc.\ 10th Symposium on Com-  puter Arithmetic}, IEEE Computer Society Press, Los Alamitos, Calif., 1991.  Extends from DP to arbitrary precision; gives portable algorithms and  general proofs.Sorensen, D., and P.~Tang, On the Orthogonality of Eigenvectors Computed  by Divide-and-Conquer Techniques, {\it SIAM J.\ Num.\ Anal.} {\bf 28}  (1991), 1752--1775.  Uses some DP arithmetic to retain orthogonality of eigenvectors  computed by a parallel divide-and-conquer scheme.Priest, D., On Properties of Floating Point Arithmetics: Numerical Stability  and the Cost of Accurate Computations, Ph.D. dissertation, University  of California at Berkeley, 1992.  More examples, organizes proofs in terms of common properties of fp  addition/subtraction, gives other summation algorithms.\***********************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国三级中文字幕hd久久精品| 色婷婷狠狠综合| 91麻豆产精品久久久久久| 久久综合九色综合97_久久久| 日本不卡高清视频| 欧美一区二区三区啪啪| 日韩国产精品91| 欧美精品一区二区高清在线观看| 蜜臀久久99精品久久久画质超高清 | 国产精品三级av在线播放| 成人晚上爱看视频| 亚洲欧美色综合| 在线播放欧美女士性生活| 激情av综合网| 国产精品影视天天线| 一区二区不卡在线播放 | 91福利小视频| 美女任你摸久久| 蜜桃视频在线观看一区| 精品一区二区三区蜜桃| 一区二区在线观看免费| 精品免费视频一区二区| 色老头久久综合| 欧美日韩精品欧美日韩精品一 | 色综合色狠狠综合色| 色噜噜夜夜夜综合网| 欧美一区二区在线观看| 久久蜜桃香蕉精品一区二区三区| 91老师国产黑色丝袜在线| 91精彩视频在线| 欧美一区二区高清| 26uuu色噜噜精品一区二区| 久久久国产精华| 夜夜操天天操亚洲| 久久精品99国产精品日本| 美女精品一区二区| 国产成人av影院| 久久精品国产**网站演员| 国产成人精品网址| 欧美日韩精品一区二区三区四区| 欧美岛国在线观看| 欧美美女一区二区在线观看| 精品国产电影一区二区| 自拍偷拍欧美精品| 国产精品色哟哟| 五月婷婷激情综合网| 一区在线观看视频| 久久久久久久久久久电影| 一区二区三区 在线观看视频| 国产在线视频精品一区| 在线观看av一区二区| 色婷婷综合中文久久一本| 日韩精品一区二区三区视频在线观看| 国产精品国产自产拍在线| 亚洲国产岛国毛片在线| 久久这里都是精品| 亚洲一区二区三区影院| 一区二区国产视频| 国产成人午夜片在线观看高清观看| 欧美午夜理伦三级在线观看| 欧美日韩亚洲综合一区| 精品视频在线免费看| 中文字幕不卡三区| 韩国一区二区在线观看| 欧美日韩一区二区三区高清| 国产精品久久久久桃色tv| 韩日av一区二区| 日韩一区二区三区高清免费看看| 精品国产乱码久久久久久久久| 一区二区三区久久久| av亚洲精华国产精华| 色哟哟亚洲精品| 国产精品视频线看| 国产一区二区女| 日本乱人伦一区| 国产精品福利一区二区三区| 国产美女精品一区二区三区| 欧美成人精品二区三区99精品| 五月激情综合婷婷| 欧美日韩国产成人在线免费| 亚洲午夜精品在线| 国产精品资源在线| 久久蜜桃av一区二区天堂| 国产精品综合二区| 2014亚洲片线观看视频免费| 蜜臀久久99精品久久久久宅男| 91精品国产综合久久久久久久久久| 久久久国产一区二区三区四区小说| 国产综合久久久久久久久久久久| 精品精品国产高清a毛片牛牛| 精品一区二区三区在线播放视频| 精品88久久久久88久久久| 国产综合色视频| 国产精品久久久久国产精品日日| www.欧美精品一二区| 亚洲精品国产视频| 欧美日韩中字一区| 蜜臀91精品一区二区三区 | 久久免费电影网| 成人爽a毛片一区二区免费| 亚洲欧洲日韩在线| 欧美日韩在线观看一区二区| 裸体歌舞表演一区二区| 久久蜜桃香蕉精品一区二区三区| 不卡一二三区首页| 精品久久免费看| 成人aaaa免费全部观看| 夜夜揉揉日日人人青青一国产精品| 8x8x8国产精品| 国产做a爰片久久毛片| 亚洲欧美国产毛片在线| 欧美久久一二区| 福利一区二区在线| 精品国产91乱码一区二区三区 | 亚洲最新视频在线观看| 欧美电影免费观看高清完整版| 成人高清免费观看| 亚洲成a人片在线不卡一二三区| 成人的网站免费观看| 亚洲国产精品久久人人爱| 精品粉嫩aⅴ一区二区三区四区| 成人aaaa免费全部观看| 五月婷婷综合在线| 欧美高清在线精品一区| 欧美久久一二三四区| 99精品欧美一区二区三区小说| 国产日韩一级二级三级| 激情五月婷婷综合| 一区二区理论电影在线观看| 欧美精彩视频一区二区三区| 欧美日韩美女一区二区| www.色精品| 国产一区二区久久| 爽好多水快深点欧美视频| 欧美日韩电影在线| 成人性生交大片免费| 韩国女主播一区| 视频一区视频二区中文| 亚洲精品少妇30p| 国产精品美女一区二区| 精品99一区二区| 日韩一级片网站| 91精品免费观看| 欧美手机在线视频| 一本大道久久精品懂色aⅴ| 国产精品77777竹菊影视小说| 日日欢夜夜爽一区| 一级中文字幕一区二区| 国产精品久久久久一区 | 亚洲丝袜自拍清纯另类| 国产日韩欧美不卡在线| 久久综合色婷婷| 欧美成人video| 欧美白人最猛性xxxxx69交| 3atv一区二区三区| 欧美日韩黄色影视| 欧美日韩国产精选| 欧美高清视频一二三区 | 欧美一区二区三区视频| 欧美日韩精品欧美日韩精品| 欧美色图激情小说| 欧美性色欧美a在线播放| 欧美性大战xxxxx久久久| 在线观看日韩一区| 欧美三级日本三级少妇99| 欧美理论片在线| 精品精品国产高清a毛片牛牛 | 色综合激情久久| 色噜噜夜夜夜综合网| 欧美人与z0zoxxxx视频| 日韩欧美一区二区三区在线| 精品国产免费久久| 中文久久乱码一区二区| 亚洲精品视频免费看| 丝袜美腿亚洲色图| 国产毛片精品一区| eeuss鲁片一区二区三区| 91成人免费网站| 欧美一区二区在线看| 国产午夜精品在线观看| 91精品国产高清一区二区三区| 欧美成人精品3d动漫h| 国产精品每日更新| 亚洲成人免费视频| 日本美女一区二区| 成人高清视频在线| 欧美日韩一二三| 精品99一区二区| 亚洲免费观看高清| 蜜桃一区二区三区在线| 成人激情免费网站| 欧美顶级少妇做爰| 国产精品人成在线观看免费| 亚洲一区二区av在线| 激情图片小说一区| 欧美在线一二三| 欧美激情在线观看视频免费| 亚洲午夜久久久久久久久电影院| 国产真实乱子伦精品视频| 色哟哟一区二区在线观看|