C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: lx_interval.cpp,v 1.13 2014/01/30 17:23:47 cxsc Exp $ */ 00025 00026 00027 /* 00028 ** F. Blomquist, University of Wuppertal, 19.09.2007; 00029 */ 00030 00031 #include "lx_interval.hpp" 00032 00033 //class lx_real; 00034 00035 namespace cxsc { 00036 00037 // ---------------------------------------------------------------------- 00038 // ------------ Functions related to type lx_interval: ------------------ 00039 // ---------------------------------------------------------------------- 00040 00041 lx_interval::lx_interval(const real& n, const string &s) throw() 00042 // Constructor: 00043 // (10^n, string) --- > (ex,li) vom Typ lx_interval 00044 // string s must be of the form: 00045 // s = "[1.234567,1.234567]"; or: s = "[0,0]"; 00046 // or: s = "[1.234567e+20,1.234568e+20]"; 00047 // or: s = "[1.234567e-20,1.234568e-20]"; 00048 // or: s = "[0,1]"; or: s = "[-1,0]"; or: s = "[-1,+1]"; 00049 // (ex,li) is an optimal inclusion of 10^n*s; 00050 00051 // Not allowed strings: 00052 // s = "1.234567"; or: s = "1.234567e+20"; 00053 // or: s = "[1.2,1.2"; or: s = "1.2,1.2]"; 00054 // or: s = "+[1.2,1.2]"; or: s = "-[1.2,1.2]"; 00055 00056 { 00057 const real c1 = 3.3219280948873623; // c1 = ln(10)/ln(2) 00058 const real c2 = 2.711437152598000E+015; 00059 const real c3 = 10000.0; 00060 l_interval x(0); 00061 lx_interval u,v; 00062 real y,ay,r; 00063 int p,q,stagsave; 00064 bool neg; 00065 00066 stagsave = stagprec; 00067 00068 if (!Is_Integer(n)) 00069 cxscthrow(REAL_NOT_ALLOWED( 00070 "lx_interval(const real&, const string& )")); 00071 // Check for brackets [...] in string s: 00072 string str1 = "[", str2 = "]"; 00073 q = s.find_first_of(str1); 00074 p = s.find_first_of(str2); 00075 if (q == -1 || p == -1) 00076 cxscthrow(NO_BRACKETS_IN_STRING( 00077 "lx_interval(const real&, const string& )")); 00078 stagprec = stagprec +1; 00079 x = x + 0; // To get StagPrec(x) = actual value of stagprec; 00080 s >> x; // [a,b] <= x; x of type l_interval; 00081 00082 if (x==0) 00083 { 00084 li = 0; ex = 0; 00085 } 00086 else 00087 { 00088 neg = (n<0); 00089 y = n*c1; 00090 y = std::floor(_double(y)); 00091 ay = abs(y); r = abs(n); 00092 if (ay>=Max_Int_R) 00093 cxscthrow(REAL_NOT_ALLOWED( 00094 "lx_interval(const real&, const string& )")); 00095 u = power( lx_interval(0,l_interval(10)),r ); 00096 v = lx_interval(ay,l_interval(1)); 00097 if (r > c2) 00098 { 00099 v = lx_interval(ay-c3,l_interval(1)); 00100 times2pown(u,-c3); 00101 } 00102 if (neg) u = v/u; 00103 else u = u/v; 00104 u = u*lx_interval(0,x); 00105 li = li_part(u); 00106 r = expo(u); 00107 ex = add_real(y,r); 00108 } 00109 stagprec = stagsave; 00110 li = adjust(li); 00111 } 00112 00113 void scale_down(lx_interval &a) 00114 // scale_down skaliert a moeglichst weit nach unten, ohne 00115 // dass dabei binaere Stellen verloren gehen. 00116 // Der mathematische Wert von a bleibt dabei erhalten, d.h. 00117 // 2^(a.ex)*a.li hat vor und nach der Skalierung stets den 00118 // gleichen mathematischen Wert. 00119 { 00120 int d; 00121 d = -1021 - expo_sm(a.li); 00122 // In case of a.li=0 we get d>0, and so nothing is done! 00123 if (d<0) 00124 { 00125 Times2pown(a.li,d); // a.li = a.li * 2^d 00126 a.ex = sub_real(a.ex,d); 00127 } 00128 } 00129 00130 void scale_up(lx_interval &a) 00131 // scale_up skaliert a.li moeglichst weit nach oben. 00132 // Nach der Skalierung wird jedoch a.li + a.li keinen Overflow 00133 // erzeugen. 00134 // 2^(a.ex)*a.li hat fuer d>0 vor und nach der Skalierung stets 00135 // den gleichen Wert. Nur im Fall d<0 kann es durch die 00136 // Skalierung nach unten nur zu einer minimalen Aufblaehung kommen, 00137 // denn im Fall d<0 nimmt d nur die Werte d = -1,-2 an. 00138 { 00139 int d; 00140 d = 1022 - expo_gr(a.li); 00141 if (d>-4) // if (d>-3) is also possible! 00142 { 00143 Times2pown(a.li,d); // a.li = a.li * 2^d 00144 a.ex = sub_real(a.ex,d); // to keep 2^(a.ex)*a.li constant. 00145 } 00146 } 00147 00148 l_interval & l_interval::operator = (const lx_interval &a) throw() 00149 { 00150 int exa; 00151 real p(expo(a)),exr; 00152 l_interval al(li_part(a)); 00153 l_real lrI(Inf(al)), lrS(Sup(al)); // Neu !!!!! 00154 exa = expo_gr(al); 00155 if (exa<-100000) return (*this) = al; // al = 0; 00156 exr = p + exa; 00157 if (exr > 1024) 00158 cxscthrow(OVERFLOW_ERROR("LX_INTERVAL_UNREALIZABLE_AS_L_INTERVAL: l_interval & operator = (const lx_interval &a)")); 00159 Times2pown(al,p); 00160 if (Inf(al)<0 && lrI>=0) 00161 al = SetInf(al,l_real(0)); 00162 if (Sup(al)>0 && lrS<=0) 00163 al = SetSup(al,l_real(0)); 00164 return (*this) = al; 00165 } 00166 00167 interval & interval::operator = (const lx_interval &a) throw() 00168 { 00169 l_interval al; 00170 interval z; 00171 al = a; 00172 z = al; 00173 return (*this) = z; 00174 } 00175 00176 l_interval times2powr(const l_real &a, const real &r) 00177 // b = times2powr(a,r); returns an inclusion of a*2^r <= b; 00178 // This inclusion holds only, if the following condition is 00179 // fulfilled: 00180 // ************************************************************** 00181 // * For r in [-2100,+2100] r must be an integer value; * 00182 // ************************************************************** 00183 // The above condition is NOT tested in this function !! 00184 // If r lies outside [-2100,+2100] then it holds a*2^r <= b for 00185 // any real number, unless an overflow occurs. 00186 // The function is for the internal use only! 00187 // Blomquist, 25.02,2008; 00188 { 00189 l_interval res(0),ai; 00190 double dbl; 00191 int ex; 00192 00193 if ( a != 0 ) 00194 { 00195 ai = l_interval(a); 00196 00197 if (abs(r)<2147483647) 00198 { 00199 dbl = _double(r); 00200 ex = (int) dbl; 00201 Times2pown(ai,ex); 00202 res = ai; 00203 } 00204 else 00205 if (r < -2147483645) 00206 { 00207 Times2pown(ai,-3000); 00208 res = ai; 00209 } 00210 else 00211 Times2pown(ai,3000); // produces overflow! 00212 } 00213 return res; 00214 } 00215 00216 lx_interval expo2zero(const lx_interval &a) throw(OVERFLOW_ERROR) 00217 // The exponent to base 2 of the object a is set to zero. 00218 // The return value res is an inclusion of the object a 00219 // unless an overflow occurs. 00220 { 00221 lx_interval res(0); 00222 l_interval la(li_part(a)); 00223 int exa(expo_gr(la)); 00224 real na(expo(a)), r; 00225 00226 if (exa > -100000) // a != 0; 00227 { 00228 r = add_real(exa,na); 00229 if (r > 1024) 00230 cxscthrow(OVERFLOW_ERROR( 00231 "lx_interval expo2zero(lx_interval &)")); 00232 Times2pown(la,na); 00233 res = lx_interval(0.0,la); 00234 } 00235 00236 return res; 00237 } 00238 00239 lx_interval::lx_interval(const lx_real& a, const lx_real& b) throw() 00240 { 00241 lx_real a_(a),b_(b); 00242 l_real lr; 00243 l_interval h; 00244 bool a_zero(eq_zero(a)), b_zero(eq_zero(b)); 00245 real na,nb,d; 00246 if (a_zero || b_zero) 00247 if (a_zero) 00248 { 00249 ex = expo(b); 00250 li = l_interval(0,lr_part(b)); 00251 } else 00252 { 00253 ex = expo(a); 00254 li = l_interval(lr_part(a),0); 00255 } 00256 else 00257 { // Now we have: a,b != 0: 00258 scale_up(a_); 00259 scale_up(b_); 00260 na = expo(a_); nb = expo(b_); 00261 if (na >= nb) 00262 { 00263 if (na==nb) // the most common case! 00264 { 00265 ex = na; 00266 li = l_interval(lr_part(a_),lr_part(b_)); 00267 } 00268 else // na > nb: 00269 { 00270 d = na - nb; 00271 if (d>Max_Int_R) 00272 d = Max_Int_R; 00273 ex = na; 00274 lr = lr_part(b_); 00275 h = times2powr(lr,-d); 00276 li = l_interval(lr_part(a_),Sup(h)); 00277 } 00278 } 00279 else // na < nb: 00280 { 00281 d = nb - na; 00282 if (d>Max_Int_R) 00283 d = Max_Int_R; 00284 ex = nb; 00285 lr = lr_part(a_); 00286 h = times2powr(lr,-d); 00287 li = l_interval(Inf(h),lr_part(b_)); 00288 } 00289 } 00290 } 00291 00292 lx_interval operator + (const lx_interval &a, const lx_interval &b) throw() 00293 { 00294 const real c1 = 10000.0; 00295 int stagsave = stagprec, 00296 stagmax = 39, 00297 exa,exb; 00298 real sa,sb,p,n; 00299 00300 if (stagprec>stagmax) stagprec = stagmax; 00301 00302 l_interval a1,b1; 00303 lx_interval res,A(a),B(b); 00304 interval z; 00305 00306 A = Blow(A); // If |a| is too small, a is inflated. 00307 B = Blow(B); // A <= Blow(A) is guaranteed! 00308 // With these inflations a+b <= A+B is guaranteed and 00309 // A+B is calculated without an error message unless 00310 // |A| or |B| are too great. 00311 a1 = li_part(A); b1 = li_part(B); 00312 exa = expo_gr(a1); 00313 exb = expo_gr(b1); 00314 00315 if (exa<-100000) return b; // summand a = 0 00316 if (exb<-100000) return a; // summand b = 0 00317 00318 // a,b <> 0: 00319 sa = add_real(exa,expo(A)); 00320 sb = add_real(exb,expo(B)); 00321 if (sa > sb) // |a| >= |b| 00322 { 00323 p = 1022 - exa; // p >= 0 00324 Times2pown(a1,p); 00325 n = sub_real(expo(A),p); 00326 if (n>0 && expo(B)<sub_real(n,c1)) 00327 { 00328 z = b1; 00329 if (Sup(z)<=0.0) 00330 b1 = l_interval(-MinReal,0); 00331 else 00332 if (Inf(z)>=0.0) 00333 b1 = l_interval(0,MinReal); 00334 else 00335 b1 = l_interval(-MinReal,MinReal); 00336 } 00337 else 00338 { 00339 p = sub_real(expo(B),n); 00340 Times2pown(b1,p); 00341 } 00342 } else 00343 { 00344 p = 1022 - exb; // p >= 0 00345 Times2pown(b1,p); 00346 n = sub_real(expo(B),p); 00347 if (n>0 && expo(A)<sub_real(n,c1)) 00348 { 00349 z = a1; 00350 if (Sup(z)<=0.0) 00351 a1 = l_interval(-MinReal,0); 00352 else 00353 if (Inf(z)>=0.0) 00354 a1 = l_interval(0,MinReal); 00355 else 00356 a1 = l_interval(-MinReal,MinReal); 00357 } 00358 else 00359 { 00360 p = sub_real(expo(A),n); 00361 Times2pown(a1,p); 00362 } 00363 } 00364 a1 = a1 + b1; // normal staggered addition 00365 res = lx_interval(n,a1); 00366 00367 stagprec = stagsave; 00368 res = adjust(res); 00369 return res; 00370 } 00371 00372 lx_interval operator * (const lx_interval &a, const lx_interval &b) throw() 00373 { 00374 int stagsave = stagprec, 00375 stagmax = 39, 00376 exa,exb,d,D,k; 00377 real na,nb,diff; 00378 00379 if (stagprec > stagmax) stagprec = stagmax; 00380 00381 l_interval al,bl; 00382 lx_interval a_(a),b_(b),res(0); 00383 00384 a_ = Blow(a_); // a_ is inflated, if |a_| is too small 00385 b_ = Blow(b_); // a_ = [0,0] remains unchanged 00386 00387 scale_down(a_); scale_down(b_); 00388 00389 al = li_part(a_); bl = li_part(b_); 00390 exa = expo_gr(al); 00391 exb = expo_gr(bl); 00392 00393 if (exa>-100000 && exb>-100000) // Beide Faktoren sind <> 0: 00394 { 00395 if (exa+exb <= 1022) 00396 { 00397 if (exa<0) 00398 { 00399 Times2pown(al,-exa); 00400 na = add_real(expo(a_),exa); // a = 2^na * al; 00401 d = 1022 - exb; 00402 } 00403 else // exa >= 0 00404 { 00405 na = expo(a_); 00406 d = 1022 - (exa+exb); 00407 } 00408 Times2pown(bl,d); 00409 nb = sub_real(expo(b_),d); // b = 2^nb * bl; 00410 } 00411 else // exa+exb > 1022 00412 { 00413 d = exa + exb - 1022; // d > 0; 00414 if (exa>exb) 00415 { 00416 D = exa - exb; // D > 0; 00417 if (d <= D) 00418 { 00419 Times2pown(al,-d); 00420 na = add_real(expo(a_),d); // a = 2^na * al; 00421 nb = expo(b_); 00422 } 00423 else // d > D; 00424 { 00425 k = d - D; 00426 if (k%2 != 0) k++; 00427 k = k/2; 00428 Times2pown(bl,-k); 00429 nb = add_real(expo(b_),k); // b = 2^nb * bl; 00430 k = k + D; 00431 Times2pown(al,-k); 00432 na = add_real(expo(a_),k); // a = 2^na * al; 00433 } 00434 } 00435 else // exb >= exa 00436 { 00437 D = exb - exa; // D > 0; 00438 if (d <= D) 00439 { 00440 Times2pown(bl,-d); 00441 nb = add_real(expo(b_),d); // b = 2^nb * bl; 00442 na = expo(a_); 00443 } 00444 else // d > D 00445 { 00446 k = d - D; 00447 if (k%2 != 0) k++; 00448 k = k/2; 00449 Times2pown(al,-k); 00450 na = add_real(expo(a_),k); // a = 2^na * al; 00451 k = k + D; 00452 Times2pown(bl,-k); 00453 nb = add_real(expo(b_),k); // b = 2^nb * bl; 00454 } 00455 } 00456 } 00457 al = al*bl; // normal staggered multiplication 00458 00459 if (na+nb<-Max_Int_R) // Underflow: 00460 { 00461 diff = (Max_Int_R + na) + nb; // diff < 0; 00462 Times2pown(al,diff); 00463 00464 if (Inf(al)>0) 00465 SetInf(al,0.0); 00466 else 00467 if (Sup(al)<0) 00468 SetSup(al,0.0); 00469 00470 res = lx_interval(Max_Int_N,al); 00471 } 00472 else // Without underflow 00473 { 00474 na = add_real(na,nb); // Hier normale Rechnung! 00475 res = lx_interval(na,al); 00476 // Caution: This else-block can deliver an interval res, 00477 // with a so small |res| value , that for example 00478 // res * res produces an error message. To avoide this 00479 // message, res will be sufficiently inflated: 00480 00481 if (na<Max_Int_N) // Only in extreme cases! 00482 { 00483 if (Inf(al)>0) 00484 SetInf(al,0.0); 00485 else 00486 if (Sup(al)<0) 00487 SetSup(al,0.0); 00488 00489 res = lx_interval(Max_Int_N,al); 00490 } 00491 } 00492 00493 } 00494 stagprec = stagsave; 00495 res = adjust(res); 00496 return res; 00497 } // operator * 00498 00499 lx_interval operator / (const lx_interval &a, const lx_interval &b) 00500 throw(ERROR_LINTERVAL_DIV_BY_ZERO) 00501 { 00502 int stagsave = stagprec, 00503 stagmax = 39, 00504 exa,exb,d; 00505 real na,nb,diff; 00506 if (stagprec>stagmax) stagprec = stagmax; 00507 00508 interval z; 00509 l_interval al,bl; 00510 lx_interval a_(a),b_(b),res; 00511 00512 a_ = Blow(a_); // a_ is inflated, if |a_| is too small 00513 b_ = Blow(b_); // a_ = [0,0] remains unchanged 00514 00515 scale_down(a_); 00516 scale_down(b_); 00517 al = li_part(a_); bl = li_part(b_); 00518 00519 exa = expo_gr(al); 00520 exb = expo_gr(bl); 00521 00522 if (exb < -100000) 00523 cxscthrow(ERROR_LINTERVAL_DIV_BY_ZERO("lx_interval operator/(const lx_interval &a, const lx_interval &b)")); 00524 00525 if (exa < -100000) return a; 00526 // Now it holds: a,b <> 0: 00527 00528 bool bl_point( point_intv(bl) ); 00529 00530 // First: scaling the nominator al to 1022: 00531 d = 1022 - exa; 00532 Times2pown(al,d); // expo_gr(al) = 1022; 00533 na = sub_real(expo(a_),d); // a = 2^na * al; 00534 00535 if (bl_point) 00536 { 00537 if (0<=exb && exb<=511) 00538 nb = expo(b_); 00539 else 00540 if (exb<0) 00541 { // scaling the denominator bl to 0: 00542 Times2pown(bl,-exb); 00543 nb = add_real(expo(b_),exb); // b = 2^nb * bl; 00544 } 00545 else // exb > 511; 00546 // Now scaling the denominator bl to 511: 00547 { 00548 d = 511 - exb; 00549 Times2pown(bl,d); 00550 nb = sub_real(expo(b_),d); 00551 } 00552 } 00553 else // scaling the denominator bl to 511: 00554 { 00555 d = 511 - exb; 00556 Times2pown(bl,d); 00557 nb = sub_real(expo(b_),d); 00558 } 00559 00560 z = al; 00561 al = al / bl; // Normal staggered division; 00562 // However, with too wide interval operands an overflow is possible: 00563 if ( (al==0 && z!=0) || Inf(al)>Sup(al) ) 00564 cxscthrow(OVERFLOW_ERROR("TOO_WIDE_INTERVAL_OPERANDS_IN: lx_interval operator / (const lx_interval &a, const lx_interval &b)")); 00565 00566 if (na-nb<-Max_Int_R) // Underflow: 00567 { 00568 diff = (Max_Int_R - nb) + na; // diff < 0; 00569 Times2pown(al,diff); 00570 00571 if (Inf(al)>0) 00572 SetInf(al,0.0); 00573 else 00574 if (Sup(al)<0) 00575 SetSup(al,0.0); 00576 00577 res = lx_interval(Max_Int_N,al); 00578 // +2100 delivers an additional inflation 00579 // to avoide too small results 00580 } 00581 else 00582 { // Without underflow: 00583 na = sub_real(na,nb); // Hier normale Rechnung! 00584 res = lx_interval(na,al); 00585 // Caution: This else-block can deliver an interval res, 00586 // with a so small |res| value , that for example 00587 // res * res produces an error message. To avoide this 00588 // message, res will be sufficiently inflated: 00589 00590 if (na<Max_Int_N) // Only in extreme cases! 00591 { 00592 if (Inf(al)>0) 00593 SetInf(al,0.0); 00594 else 00595 if (Sup(al)<0) 00596 SetSup(al,0.0); 00597 00598 res = lx_interval(Max_Int_N,al); 00599 } 00600 } 00601 00602 stagprec = stagsave; 00603 res = adjust(res); 00604 return res; 00605 } 00606 00607 // ----------------------- Input -------------------------------------------- 00608 00609 std::string & operator >> (std::string &s, lx_interval &a) throw() 00610 // Writes string s to variable a of type lx_interval 00611 // and returns an empty string s; 00612 // Example: s = "{-4000,[2,2]}" delivers an interval a 00613 // with: 10^(-4000)*[2,2] <= a; 00614 // Whitespaces are NOT allowed in s ! 00615 { 00616 l_interval la; 00617 real exr; 00618 int i; 00619 00620 s = skipwhitespacessinglechar (s, '{'); 00621 s >> exr; 00622 s = skipwhitespacessinglechar (s, ','); 00623 i = s.find("]"); 00624 s.erase(i+1); 00625 a = lx_interval(exr,s); 00626 s = ""; 00627 00628 return s; 00629 } 00630 00631 void operator >> (const std::string &s, lx_interval &a) throw() 00632 { 00633 // Writes strings s to variable a of type lx_interval; 00634 std::string r(s); 00635 r >> a; 00636 } 00637 00638 void operator >> (const char *s, lx_interval &a) throw() 00639 { 00640 std::string r(s); 00641 r >> a; 00642 } 00643 00644 bool StrContains(const string &s, const char &a, const char &b) 00645 // returns 1, if s contains char a or char b, otherwise 0; 00646 { 00647 int ia,ib; 00648 ia = s.find(a,0); 00649 ib = s.find(b,0); 00650 return (ia>=0 || ib>=0); 00651 } 00652 00653 std::istream & operator >> (std::istream &s, lx_interval &a) throw() 00654 // s must have the form: { p,[r1,r2] }, where r1<=r2 are real values 00655 // and the exponent p of type real must be an integer value to base 10; 00656 // The integer value condition and r1<=r2 are tested in the constructor 00657 // call: a = lx_interval(exr,str); 00658 // Blomquist, 27.01.2008; 00659 { 00660 char c; 00661 real exr; 00662 string str,sh; 00663 00664 skipeolnflag = inpdotflag = true; 00665 c = skipwhitespacessinglechar (s, '{'); 00666 if (inpdotflag) s.putback(c); 00667 s >> SaveOpt >> exr; 00668 c = skipwhitespacessinglechar (s, ','); 00669 if (inpdotflag) s.putback(c); 00670 skipeolnflag = inpdotflag = true; 00671 s >> str >> RestoreOpt; 00672 00673 while ( !StrContains(str,']','}') ) 00674 { 00675 c = skipwhitespaces (s); 00676 if (inpdotflag && c != '}') s.putback(c); 00677 if (c == '}') break; 00678 if (c == ' ') break; 00679 s >> sh; 00680 str = str + sh; 00681 } 00682 00683 a = lx_interval(exr,str); 00684 00685 if (!waseolnflag) 00686 { 00687 skipeolnflag = false; inpdotflag = true; 00688 c = skipwhitespaces (s); 00689 if (inpdotflag && c != '}') 00690 s.putback(c); 00691 } 00692 00693 return s; 00694 } 00695 00696 // ----------------------- Output -------------------------------------------- 00697 00698 void Bin2Dec(const lx_interval& a, real& p, l_interval& m) 00699 // Calculates for a given interval a of type lx_interval the 00700 // exponent p and the classic staggered interval m of type 00701 // l_interval, so that the inclusion 00702 // a <= 10^p * m is guaranteed. 00703 // Blomquist, 26.09.2008; 00704 { 00705 const real c1 = 0.301029995663981195; 00706 const real c2 = 9.007199254738000E+015; 00707 const real c3 = 10000.0; 00708 l_interval x; 00709 lx_interval u,v; 00710 real y,k,l; 00711 int stagsave; 00712 bool neg; 00713 00714 stagsave = stagprec; 00715 stagprec = stagprec + 1; 00716 00717 x = li_part(a); 00718 y = expo(a); 00719 neg = y<0; 00720 if (x==0) 00721 { 00722 p = 0; m = 0; 00723 } 00724 else 00725 { 00726 p = y*c1; 00727 p = std::floor(_double(p)); 00728 y = abs(y); 00729 u = lx_interval(y,l_interval(1)); 00730 v = power( lx_interval(0,l_interval(10)),abs(p) ); 00731 if (y > c2) 00732 { 00733 u = lx_interval(y-c3,l_interval(1)); 00734 times2pown(v,-c3); 00735 } 00736 if (neg) u = v/u; 00737 else u = u/v; 00738 u = u*lx_interval(0,x); 00739 m = li_part(u); 00740 k = expo(u); 00741 l = k*c1; 00742 l = std::floor(_double(l)) + 1; 00743 p = p+l; 00744 u = lx_interval(k,l_interval(1)) / 00745 power( lx_interval(0,l_interval(10)),l ); 00746 u = u * lx_interval(0,m); 00747 k = expo(u); 00748 m = li_part(u); 00749 Times2pown(m,k); 00750 } 00751 stagprec = stagsave; 00752 m = adjust(m); 00753 } // Bin2Dec(...) 00754 00755 std::ostream& operator << (std::ostream& s,const lx_interval& a) throw() 00756 // An interval a of type lx_interval is written to the 00757 // output channel in the decimal form: 00758 // { 10**(p), l_interval m } = 10^p * m; 00759 // The following inclusion is realized: a <= 10^p * m; 00760 // Blomquist, 18.01.2008; 00761 { 00762 real p; 00763 l_interval m; 00764 00765 Bin2Dec(a,p,m); 00766 00767 s << "{ " 00768 << "10**(" 00769 << SaveOpt << SetPrecision(0,0) << Fixed << p << RestoreOpt 00770 << ")" 00771 << "*" 00772 << m 00773 << " }"; 00774 return s; 00775 } 00776 00777 std::string & operator << (std::string &s, const lx_interval &a) throw() 00778 // The value of a variable a of type lx_interval is copied to a string s. 00779 // s has the form: {2**(ex), li} = 2^ex * li; 00780 { 00781 std::stringstream ss; 00782 string str; 00783 s+="{2**("; 00784 ss << SaveOpt << SetPrecision(0,0) << Fixed << a.ex << RestoreOpt; 00785 ss >> str; 00786 s += str; 00787 s+=")*"; 00788 s << a.li; 00789 s+='}'; 00790 return s; 00791 } 00792 00793 00794 // ----- Help Functions, declared in lx_interval.hpp outside --------------- 00795 // --------------------- the class lx_interval------------------------------ 00796 00797 l_interval point_max(void) 00798 // returns a staggered point interval with maximum exponent 1020, 00799 // whereby nearly all mantissa bits are set. 00800 { 00801 l_real lr; 00802 l_interval li = sqrt(l_interval(3.995)), res(li); 00803 times2pown(li,1019); 00804 lr = Inf(li); 00805 lr = ((lr + Inf(res)) + MinReal) + minreal; 00806 res = l_interval(lr); 00807 return res; 00808 } 00809 00810 l_interval point_any(int n) 00811 // returns a staggered point interval with exponent n, 00812 // whereby nearly all mantissa bits are set. 00813 // -1074 <= n <= +1020; 00814 { 00815 int n_(n); 00816 l_interval res; 00817 00818 if (n_>1020) n_ = 1020; 00819 if (n_<-1074) n_ = -1074; 00820 res = point_max(); 00821 times2pown(res,n_ - 1020); 00822 return l_interval(Inf(res+MinReal)); 00823 } 00824 00825 l_interval wide_max(void) 00826 // returns a staggered interval a with maximum exponent 1020 00827 // and diam(a)>0, whereby nearly all mantissa bits are set. 00828 { 00829 l_interval a = point_max(); 00830 return a + interval(MinReal,2*MinReal); 00831 } 00832 00833 l_interval wide_any(int n) 00834 // returns a staggered point interval a with exponent n, 00835 // and diam(a)>0, whereby nearly all mantissa bits are set. 00836 // -1074 <= n <= +1020; 00837 { 00838 l_interval a = point_any(n); 00839 return a + interval(MinReal,2*MinReal); 00840 } 00841 00842 // ---------------------------------------------------------------------------- 00843 // ---------------- Functions related to class lx_real ------------------------ 00844 // ---------------------------------------------------------------------------- 00845 00846 lx_real::lx_real(const real& n, const string &s) throw() 00847 // Constructor: 00848 // (10^n, string) --- > (ex,lr) vom Typ lx_real 00849 // string s must be of the form: 00850 // s = "1.234567"; or: s = "0"; 00851 // or: s = "1.234567e+20"; 00852 // or: s = "1.234567e-20"; 00853 // (ex,li) is an approximation of 10^n*s; 00854 { 00855 const real c1 = 3.3219280948873623; // c1 = ln(10)/ln(2) 00856 const real c2 = 2.711437152598000E+015; 00857 const real c3 = 10000.0; 00858 l_real x(0); 00859 lx_interval u,v; 00860 real y,ay,r; 00861 int stagsave; 00862 bool neg; 00863 00864 stagsave = stagprec; 00865 00866 if (!Is_Integer(n)) 00867 cxscthrow(REAL_NOT_ALLOWED( 00868 "lx_real(const real&, const string& )")); 00869 stagprec = stagprec +1; 00870 x = x + 0; // To get StagPrec(x) = actual value of stagprec; 00871 s >> x; // x ~ s; x of type l_real; 00872 if (x==0) 00873 { 00874 lr = 0; ex = 0; 00875 } 00876 else 00877 { 00878 neg = (n<0); 00879 y = n*c1; 00880 y = std::floor(_double(y)); 00881 ay = abs(y); r = abs(n); 00882 if (ay>=Max_Int_R) 00883 cxscthrow(REAL_NOT_ALLOWED( 00884 "lx_real(const real&, const string& )")); 00885 u = power( lx_interval(0,l_interval(10)),r ); 00886 v = lx_interval(ay,l_interval(1)); 00887 if (r > c2) 00888 { 00889 v = lx_interval(ay-c3,l_interval(1)); 00890 times2pown(u,-c3); 00891 } 00892 if (neg) u = v/u; 00893 else u = u/v; 00894 u = u*lx_interval(0,l_interval(x)); 00895 lr = mid(li_part(u)); 00896 r = expo(u); 00897 ex = add_real(y,r); 00898 } 00899 stagprec = stagsave; 00900 lr = adjust(lr); 00901 } 00902 00903 std::string & operator >> (std::string &s, lx_real &a) throw() 00904 // Writes string s to variable a of type lx_real 00905 // and returns an empty string s; 00906 // Example: s = "{-4000,2}" delivers a value a 00907 // with: 10^(-4000)*2 ~ a; 00908 { 00909 real exr; 00910 int i; 00911 00912 s = skipwhitespacessinglechar (s, '{'); 00913 s >> exr; 00914 s = skipwhitespacessinglechar (s, ','); 00915 i = s.find("}"); 00916 s.erase(i+1); 00917 a = lx_real(exr,s); 00918 s = ""; 00919 00920 return s; 00921 } 00922 00923 void operator >> (const std::string &s, lx_real &a) throw() 00924 { 00925 // Writes string s to variable a of type lx_real; 00926 std::string r(s); 00927 r >> a; 00928 } 00929 00930 void operator >> (const char *s, lx_real &a) throw() 00931 { 00932 std::string r(s); 00933 r >> a; 00934 } 00935 00936 bool Str_Contains(const string &s, const char &a, const char &b) 00937 // returns 1, if s contains char a or char b, otherwise 0; 00938 { 00939 int ia,ib; 00940 ia = s.find(a,0); 00941 ib = s.find(b,0); 00942 return (ia>=0 || ib>=0); 00943 } 00944 00945 std::istream & operator >> (std::istream &s, lx_real &a) throw() 00946 // s must have the form: { p,r }, where r is a real value 00947 // and the exponent p of type real must be an integer value to base 10; 00948 // The integer value condition is tested in the constructor call: 00949 // a = lx_interval(exr,str); 00950 // Blomquist, 06.101.2008; 00951 { 00952 char c; 00953 real exr; 00954 string str,sh; 00955 skipeolnflag = inpdotflag = true; 00956 c = skipwhitespacessinglechar (s, '{'); 00957 if (inpdotflag) s.putback(c); 00958 s >> SaveOpt >> exr; 00959 c = skipwhitespacessinglechar (s, ','); 00960 if (inpdotflag) s.putback(c); 00961 skipeolnflag = inpdotflag = true; 00962 s >> str >> RestoreOpt; 00963 while ( !Str_Contains(str,']','}') ) 00964 { 00965 c = skipwhitespaces (s); 00966 if (inpdotflag && c != '}') s.putback(c); 00967 if (c == '}') break; 00968 if (c == ' ') break; 00969 s >> sh; 00970 str = str + sh; 00971 } 00972 00973 a = lx_real(exr,str); 00974 00975 if (!waseolnflag) 00976 { 00977 skipeolnflag = false; inpdotflag = true; 00978 c = skipwhitespaces (s); 00979 if (inpdotflag && c != '}') 00980 s.putback(c); 00981 } 00982 return s; 00983 } 00984 00985 00986 bool operator == (const lx_real &a, const lx_real &b) throw() 00987 { 00988 const real c1 = 1e20; 00989 l_real ar(lr_part(a)), br(lr_part(b)); 00990 real na(expo(a)), nb(expo(b)); 00991 int exa(expo_gr(ar)), exb(expo_gr(br)),d; 00992 bool a_0(exa<-100000), b_0(exb<-100000), res; 00993 interval z(0); 00994 00995 if (a_0 || b_0) res = (a_0 == b_0); 00996 else // a,b <> 0: 00997 { 00998 d = exa-exb; 00999 if (d>0) 01000 { // br nach oben skalieren: (Overflow dabei nicht moeglich!) 01001 Times2pown(br,z,d); 01002 nb = nb - d; 01003 if (abs(nb)>Max_Int_R) 01004 nb = c1; // equality not possible 01005 } else // d<=0: 01006 { // ar nach oben skalieren: (Overflow dabei nicht moeglich!) 01007 Times2pown(ar,z,-d); 01008 na = na + d; 01009 if (abs(na)>Max_Int_R) 01010 na = c1; // equality not possible 01011 } 01012 res = (na==nb && ar==br); 01013 } 01014 return res; 01015 } 01016 01017 bool operator > (const lx_real &a, const lx_real &b) throw() 01018 { 01019 l_real lra(lr_part(a)), lrb(lr_part(b)); 01020 bool zero_a(eq_zero(a)), zero_b(eq_zero(b)), bl(false); 01021 real na,nb,d; 01022 double dbl; 01023 interval z(0); 01024 int D; 01025 01026 if (zero_a) return sm_zero(b); 01027 if (zero_b) return gr_zero(a); 01028 // Now we have: a,b != 0: 01029 na = expo(a); nb = expo(b); 01030 d = na - nb; 01031 01032 if (na==nb) 01033 bl = (lra >lrb); 01034 else 01035 if (na>nb) 01036 { 01037 if (d > 1024-expo_gr(lra)) 01038 // Scaling not possible 01039 bl = (sign(lra)>0) ? true : false; 01040 else 01041 { 01042 dbl = _double(d); 01043 D = (int) dbl; 01044 Times2pown(lra,z,D); 01045 bl = lra > lrb; 01046 } 01047 } 01048 else // nb > na 01049 { 01050 if (d < expo_gr(lrb)-1024) 01051 // Scaling not possible 01052 bl = (sign(lrb)<0) ? true : false; 01053 else 01054 { 01055 dbl = _double(-d); 01056 D = (int) dbl; 01057 Times2pown(lrb,z,D); 01058 bl = lra > lrb; 01059 } 01060 } 01061 01062 return bl; 01063 } 01064 01065 void scale_up(lx_real &a) throw() 01066 // scale_up(a) scales a.lr upwardly as far as possible. 01067 // Notice: a.lr must absolutely be sorted, i.e. for 01068 // example: a.lr[1]=1e50, a.lr[2]=1e20, a.lr[3]=1; 01069 // In case of (d>0 && a.ex-d >= -Max_Int_R) the values 01070 // of 2^(a.ex)*a.lr are equal before and after the scaling. 01071 // In case of (d<=0 || a.ex-d < -Max_Int_R) no scaling is done. 01072 { 01073 interval z(0); 01074 int d; 01075 d = 1023 - expo_gr(a.lr); // d >= 0, if a.lr <> 0; 01076 if (d>0 && a.ex >= -Max_Int_R+d) // If (a==0) then d<0 and nothing is done! 01077 { 01078 Times2pown(a.lr,z,d); // a.lr wird mit 2^d multipliziert. 01079 a.ex = a.ex - d; // damit 2^(a.ex)*a.li konstant bleibt. 01080 } 01081 } 01082 01083 void scale_down(lx_real &a) throw() 01084 // scale_down skaliert a moeglichst weit nach unten, ohne 01085 // dass dabei binaere Stellen verloren gehen. 01086 // Der mathematische Wert von a bleibt dabei erhalten, d.h. 01087 // 2^(a.ex)*a.li hat vor und nach der Skalierung stets den 01088 // gleichen mathematischen Wert. 01089 { 01090 interval z(0); 01091 int d; 01092 d = -1021 - expo_sm(a.lr); 01093 // In case of a.lr=0 we get d>0, and so nothing is done! 01094 if (d<0 && a.ex <= Max_Int_R+d) 01095 { 01096 Times2pown(a.lr,z,d); // a.lr = a.lr * 2^d 01097 a.ex = a.ex - d; 01098 } 01099 } 01100 01101 01102 lx_real upper_bnd(const lx_real& x) throw() 01103 // y = upper_bnd(x) calculates an upper bound y of x < y; 01104 // lr = lr_part(x); (See the following code.) 01105 // The components lr[1],lr[2], ... ,lr[StagPrec(x)] must be sorted! 01106 { 01107 int stagsave = stagprec, 01108 p(StagPrec(x)),ex_gr; 01109 stagprec = p; 01110 01111 lx_real res; 01112 l_real lr(lr_part(x)); 01113 real ex(expo(x)); 01114 01115 lr = lr + 0; // sorting the lr[i] 01116 res = lx_real(ex,lr); 01117 if (p>1) 01118 scale_up(res); 01119 lr = lr_part(res); 01120 ex = expo(res); 01121 ex_gr = expo_gr(lr); 01122 if (ex_gr>-10000000) 01123 { // x<>0: 01124 if (lr[1]==MaxReal) 01125 { 01126 times2pown(lr,-1); 01127 ex = add_real(ex,1); 01128 } 01129 lr[p] = succ(lr[p]); 01130 lr = lr + 0; // sorting lr ! 01131 res = lx_real(ex,lr); 01132 } 01133 else // x = 0: 01134 { 01135 lr = minreal; 01136 lr = adjust(lr); 01137 lr = lr + 0; // sorting lr ! 01138 res = lx_real(-Max_Int_R,lr); 01139 } 01140 stagprec = stagsave; 01141 01142 return res; 01143 } // upper_bnd(...) 01144 01145 lx_real lower_bnd(const lx_real& x) throw() 01146 // y = lower_bnd(x) calculates a rather great lower bound y of x > y; 01147 // lr = lr_part(x); (See the following code.) 01148 // The components lr[1],lr[2], ... ,lr[StagPrec(x)] must be sorted! 01149 { 01150 int stagsave = stagprec, 01151 p(StagPrec(x)),ex_gr; 01152 01153 stagprec = p; 01154 lx_real res; 01155 l_real lr(lr_part(x)); 01156 real ex(expo(x)); 01157 01158 lr = lr + 0; // sorting the lr[i] 01159 res = lx_real(ex,lr); 01160 if (p>1) 01161 scale_up(res); 01162 lr = lr_part(res); 01163 ex = expo(res); 01164 ex_gr = expo_gr(lr); 01165 if (ex_gr>-10000000) 01166 { 01167 if (lr[1]==-MaxReal) 01168 { 01169 times2pown(lr,-1); 01170 ex = add_real(ex,1); 01171 } 01172 lr[p] = pred(lr[p]); 01173 lr = lr + 0; // sorting lr ! 01174 res = lx_real(ex,lr); 01175 } 01176 else // x = 0; 01177 { 01178 lr = -minreal; 01179 lr = adjust(lr); 01180 lr = lr + 0; // sorting lr ! 01181 res = lx_real(-Max_Int_R,lr); 01182 } 01183 stagprec = stagsave; 01184 return res; 01185 } // lower_bnd(...) 01186 01187 lx_real operator + (const lx_real &a, const lx_real &b) throw() 01188 // An approximation of (a+b) is calculated. In most of the cases 01189 // a maximum of accuracy is achieved. 01190 { 01191 //const real c1 = 10000.0; 01192 const int c2 = 1022, 01193 c3 = -100000; 01194 int stagsave = stagprec, 01195 stagmax = 39, 01196 exa,exb; 01197 real sa,sb,p,n; 01198 01199 if (stagprec>stagmax) stagprec = stagmax; 01200 l_real a1,b1; 01201 lx_real res(0),A(a),B(b); 01202 01203 a1 = lr_part(A); b1 = lr_part(B); 01204 exa = expo_gr(a1); 01205 exb = expo_gr(b1); 01206 01207 if (exa<c3) return b; // summans a = 0; 01208 if (exb<c3) return a; // summans b = 0; 01209 01210 // From now on: a,b <> 0 01211 sa = add_real(exa,expo(A)); 01212 sb = add_real(exb,expo(B)); 01213 if (sa > sb) // |a| >= |b| 01214 { 01215 p = c2 - exa; 01216 Times2pown(a1,p); 01217 n = sub_real(expo(A),p); 01218 p = sub_real(expo(B),n); 01219 Times2pown(b1,p); 01220 } 01221 else 01222 { 01223 p = c2 - exb; 01224 Times2pown(b1,p); 01225 n = sub_real(expo(B),p); 01226 p = sub_real(expo(A),n); 01227 Times2pown(a1,p); 01228 } 01229 a1 = a1 + b1; 01230 res = lx_real(n,a1); 01231 01232 stagprec = stagsave; 01233 res = adjust(res); 01234 return res; 01235 } 01236 01237 lx_real operator * (const lx_real& a, const lx_real& b) throw() 01238 // An approximation of (a*b) is calculated. In most of the cases 01239 // a maximum of accuracy is achieved. 01240 { 01241 int stagsave = stagprec, 01242 stagmax = 39, 01243 exa,exb,d,D,k; 01244 real na,nb,diff; 01245 01246 if (stagprec > stagmax) stagprec = stagmax; 01247 01248 l_real al,bl; 01249 lx_real a_(a),b_(b),res(0); 01250 01251 scale_down(a_); scale_down(b_); 01252 01253 al = lr_part(a_); bl = lr_part(b_); 01254 exa = expo_gr(al); 01255 exb = expo_gr(bl); 01256 01257 if (exa>-100000 && exb>-100000) // Beide Faktoren sind <> 0: 01258 { 01259 if (exa+exb <= 1022) 01260 { 01261 if (exa<0) 01262 { 01263 Times2pown(al,-exa); 01264 na = add_real(expo(a_),exa); // a = 2^na * al; 01265 d = 1022 - exb; 01266 } 01267 else // exa >= 0 01268 { 01269 na = expo(a_); 01270 d = 1022 - (exa+exb); 01271 } 01272 Times2pown(bl,d); 01273 nb = sub_real(expo(b_),d); // b = 2^nb * bl; 01274 } 01275 else // exa+exb > 1022 01276 { 01277 d = exa + exb - 1022; // d > 0; 01278 if (exa>exb) 01279 { 01280 D = exa - exb; // D > 0; 01281 if (d <= D) 01282 { 01283 Times2pown(al,-d); 01284 na = add_real(expo(a_),d); // a = 2^na * al; 01285 nb = expo(b_); 01286 } 01287 else // d > D; 01288 { 01289 k = d - D; 01290 if (k%2 != 0) k++; 01291 k = k/2; 01292 Times2pown(bl,-k); 01293 nb = add_real(expo(b_),k); // b = 2^nb * bl; 01294 k = k + D; 01295 Times2pown(al,-k); 01296 na = add_real(expo(a_),k); // a = 2^na * al; 01297 } 01298 } 01299 else // exb >= exa 01300 { 01301 D = exb - exa; // D > 0; 01302 if (d <= D) 01303 { 01304 Times2pown(bl,-d); 01305 nb = add_real(expo(b_),d); // b = 2^nb * bl; 01306 na = expo(a_); 01307 } 01308 else // d > D 01309 { 01310 k = d - D; 01311 if (k%2 != 0) k++; 01312 k = k/2; 01313 Times2pown(al,-k); 01314 na = add_real(expo(a_),k); // a = 2^na * al; 01315 k = k + D; 01316 Times2pown(bl,-k); 01317 nb = add_real(expo(b_),k); // b = 2^nb * bl; 01318 } 01319 } 01320 } 01321 al = al*bl; // normal staggered multiplication 01322 01323 if (na+nb<-Max_Int_R) // Underflow: 01324 { 01325 diff = (Max_Int_R + na) + nb; // diff < 0; 01326 Times2pown(al,diff); 01327 res = lx_real(-Max_Int_R,al); 01328 } 01329 else // Without underflow 01330 { 01331 na = add_real(na,nb); // Hier normale Rechnung! 01332 res = lx_real(na,al); 01333 } 01334 01335 } 01336 stagprec = stagsave; 01337 res = adjust(res); 01338 return res; 01339 } // operator * 01340 01341 lx_real operator / (const lx_real &a, const lx_real &b) throw(DIV_BY_ZERO) 01342 { 01343 int stagsave = stagprec, 01344 stagmax = 39, 01345 exa,exb,d; 01346 real na,nb,diff; 01347 if (stagprec>stagmax) stagprec = stagmax; 01348 01349 l_real al,bl; 01350 lx_real a_(a),b_(b),res; 01351 01352 scale_down(a_); 01353 scale_down(b_); 01354 al = lr_part(a_); bl = lr_part(b_); 01355 01356 exa = expo_gr(al); 01357 exb = expo_gr(bl); 01358 01359 if (exb < -100000) 01360 cxscthrow(DIV_BY_ZERO("lx_real operator/(const lx_real &a, const lx_real &b)")); 01361 01362 if (exa < -100000) return a; 01363 // Now it holds: a,b <> 0: 01364 // First: scaling the nominator al to 1022: 01365 d = 1022 - exa; 01366 Times2pown(al,d); // expo_gr(al) = 1022; 01367 na = sub_real(expo(a_),d); // a = 2^na * al; 01368 if (0<=exb && exb<=511) 01369 nb = expo(b_); 01370 else 01371 if (exb<0) 01372 { // scaling the denominator bl to 0: 01373 Times2pown(bl,-exb); 01374 nb = add_real(expo(b_),exb); // b = 2^nb * bl; 01375 } 01376 else // exb > 511; 01377 // Now scaling the denominator bl to 511: 01378 { 01379 d = 511 - exb; 01380 Times2pown(bl,d); 01381 nb = sub_real(expo(b_),d); 01382 } 01383 01384 al = al / bl; // Normal staggered division; 01385 if (na-nb<-Max_Int_R) // Underflow: 01386 { 01387 diff = (Max_Int_R - nb) + na; // diff < 0; 01388 Times2pown(al,diff); 01389 res = lx_real(-Max_Int_R,al); 01390 } 01391 else 01392 { // Without underflow: 01393 na = sub_real(na,nb); // Hier normale Rechnung! 01394 res = lx_real(na,al); 01395 } 01396 01397 stagprec = stagsave; 01398 res = adjust(res); 01399 01400 return res; 01401 } // operator / 01402 01403 l_real & l_real::operator = (const lx_real& a) throw() 01404 { 01405 int exar; 01406 real p(expo(a)), exr; 01407 l_real ar(lr_part(a)); 01408 exar = expo_gr(ar); 01409 if (exar<-100000) return (*this) = ar; // ar = 0; 01410 exr = p + exar; 01411 if (exr > 1024) 01412 cxscthrow(OVERFLOW_ERROR( 01413 "LX_REAL_UNREALIZABLE_AS_L_REAL: l_real & operator = (const lx_real& a)")); 01414 Times2pown(ar,p); 01415 01416 return *this = ar; 01417 } 01418 01419 real & real::operator = (const lx_real& a) throw() 01420 { 01421 l_real lr; 01422 real x; 01423 01424 lr = a; 01425 x = lr; 01426 01427 return *this = x; 01428 } 01429 01430 // ------------------------------------------------------------------------------- 01431 // ------------------------------------------------------------------------------- 01432 01433 real expo_RelDiam(const l_interval &x) 01434 // rd := RelDiam(x) is defined as usual; 01435 // rd '=' 2^n; n is returned by expo_RelDiam(); 01436 // |n| is a good approximation of the first 01437 // common binary digits of the interval x. 01438 // x is a point interval --> n <= -2147483647 01439 // x = [4,5] --> n = -1; 01440 // x = [20000,20001] --> n = -14; 01441 // This function is only for the internal use! 01442 // Blomquist, 11.02.2008; 01443 { 01444 lx_real R; 01445 real n; 01446 lx_interval t; 01447 l_real r1(Inf(x)),r2(Sup(x)); 01448 t = lx_interval(r2) - lx_interval(r1); 01449 01450 if ( in(0.0,x) ) 01451 R = Sup(t); 01452 else 01453 { 01454 R = Sup( t / lx_interval( AbsMin(x) ) ); 01455 } 01456 n = expo(R) + expo_gr(lr_part(R)); 01457 01458 return n; 01459 } // expo_RelDiam() 01460 01461 // -------------------------------------------------------------------------- 01462 // -------------- Elementary functions of type lx_interval ------------------ 01463 // -------------------------------------------------------------------------- 01464 01465 lx_interval sqrt(const lx_interval &a) throw() 01466 { 01467 int stagsave = stagprec, 01468 stagmax = 30; // l_imath.cpp: sqrt() uses stagmax = 30; 01469 if (stagprec>stagmax) stagprec = stagmax; 01470 01471 lx_interval res; 01472 l_interval la(li_part(a)); 01473 real na(expo(a)),r(0); 01474 int exa(expo_gr(la)),d; 01475 01476 if (exa<-100000) res = 0.0; // la = 0; 01477 else // la <> 0; 01478 { 01479 if ( !Is_Integer(na/2) ) 01480 { 01481 r = -1.0; 01482 if (na>0) 01483 na = (na-1)/2 + 1; 01484 else na = (na+1)/2; 01485 } 01486 else // na ist gerade 01487 na = na/2; 01488 01489 d = 1024 - exa; // d >= 0; 01490 r = r - d; 01491 if ( !Is_Integer(r/2) ) 01492 { 01493 r = r + 1; 01494 d--; 01495 } 01496 Times2pown(la,d); 01497 na = na + r/2; 01498 la = sqrt(la); 01499 res = lx_interval(na,la); 01500 } 01501 01502 stagprec = stagsave; 01503 res = adjust(res); 01504 return res; 01505 } // sqrt() 01506 01507 lx_interval sqr(const lx_interval &x) throw() 01508 { 01509 int stagsave = stagprec, 01510 stagmax = 39; 01511 if (stagprec>stagmax) stagprec = stagmax; 01512 01513 lx_interval y; 01514 l_interval xl(li_part(x)); 01515 01516 if (Inf(xl) >= 0.0) 01517 y = x*x; 01518 else if (Sup(xl) <= 0.0) 01519 { 01520 y = lx_interval(expo(x),l_interval(-Sup(xl),-Inf(xl))); 01521 y = (y) * (y); 01522 } else 01523 { 01524 if (abs(Inf(xl)) >= abs(Sup(xl))) 01525 y = lx_interval(expo(x),l_interval(0.0,abs(Inf(xl)))); 01526 else y = lx_interval(expo(x),l_interval(0.0,abs(Sup(xl)))); 01527 y = (y) * (y); 01528 } 01529 01530 stagprec = stagsave; 01531 y = adjust(y); 01532 return y; 01533 } 01534 01535 lx_interval Lnp1(const lx_interval &x) throw() 01536 // Calculating an inclusion of ln(1+x) for 01537 // not too wide intervals, |x| <= 1e-7; 01538 // This function is for the internal use only, 01539 // see the functions ln(...), lnp1(...); 01540 // Blomquist, 27.02.2008; 01541 { 01542 lx_interval res(0),z2,zeta,Ri,Two; 01543 l_interval xli; 01544 int N,ex,p; 01545 real m,expox; 01546 01547 p = stagprec; 01548 xli = li_part(x); 01549 ex = expo_gr(xli); 01550 if (ex>-100000) // x <> 0 01551 { 01552 expox = expo(x); 01553 if (expox < 3-27*p-ex) N = 0; 01554 else 01555 { 01556 m = ex + expox; // m = ex + expo(x); 01557 N = (int) _double( (53*p-4)/(2*(1-m)) ); 01558 } 01559 // N: Polynomial degree, 0<=N<=42; 01560 zeta = x / (2+x); 01561 Two = lx_interval(2); 01562 Ri = lx_interval( Sup(abs(zeta)) ); 01563 Ri = sqr(Ri); 01564 if (N==0) 01565 res = Two; 01566 else // N >= 1: 01567 { 01568 z2 = sqr(zeta); // z2 = zeta^2 01569 // Evaluating the polynomial: 01570 res = Two / (2*N+1); // res = a_(N) 01571 for (int i=N-1; i>=0; --i) 01572 res = res*z2 + Two/(2*i+1); 01573 // Calculating the absolute approximation error: 01574 Ri = power(Ri,N+1)/(N+1); 01575 } 01576 // Implementing the approximation error: 01577 res += lx_interval(lx_real(0),Sup(Ri)); 01578 res *= zeta; 01579 } // x <> 0; 01580 01581 return res; 01582 } // Lnp1(...) 01583 01584 lx_interval Ln_(const lx_interval &x) throw() 01585 { 01586 lx_interval T(0.0); 01587 l_interval lx(li_part(x)); 01588 interval z; 01589 real eps; 01590 int exa(expo_gr(lx)),k(0); 01591 real nx(expo(x)),n; 01592 // we have: Inf(x)>0 --> exa <> -2147483648: 01593 if (abs(nx)<5000) 01594 { 01595 n = exa + nx; // nx is a guaranteed integer! 01596 if (n==0 || n==1) 01597 { 01598 T = x - 1.0; 01599 lx = T; 01600 if (Sup(abs(lx))<1e-7) 01601 { 01602 T = Lnp1(T); 01603 goto fertig; 01604 } 01605 } 01606 } 01607 T = x; 01608 times2pown(T,-nx); 01609 times2pown(T,-exa); // T: 1st reduced argument 01610 lx = T; 01611 z = lx; 01612 eps = Sup(1-z); 01613 if (eps>1e-12) 01614 { 01615 eps = (ln(eps) + 6*ln_N[8])/ln_N[0]; 01616 k = (int) _double(eps); 01617 if (k<=0) k = 0; 01618 } 01619 for (int j=1; j<=k; j++) 01620 T = sqrt(T); // T: 2nd reduced argument, 01621 // T = [2^k]sqrt(T); 01622 T = Lnp1(T-1.0); 01623 if (k>0) times2pown(T,k); 01624 T = nx*Ln2_lx_interval() + exa*Ln2_lx_interval() + T; 01625 01626 fertig: 01627 return T; 01628 } // Ln_(...) 01629 01630 lx_interval ln(const lx_interval &x) throw() 01631 { 01632 int stagsave = stagprec, 01633 stagmax = 39; 01634 if (stagprec>stagmax) stagprec = stagmax; 01635 01636 lx_interval res,a; 01637 01638 if (Inf(li_part(x))<=0) cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF( 01639 "lx_interval ln(const lx_interval &)")); 01640 // Now we have: Inf(x)>0: 01641 real r; 01642 r = expo_RelDiam(li_part(x)); 01643 if (r > -107) // If the rel. diam of x is too great 01644 { // the ln function is calculated at the 01645 // boundary points of the interval x. Thus, the 01646 // inclusion res is: [Inf(res),Sup(a)] 01647 res = lx_interval(Inf(x)); 01648 res = Ln_(res); 01649 a = lx_interval(Sup(x)); 01650 a = Ln_(a); 01651 res = lx_interval(Inf(res),Sup(a)); 01652 } 01653 else 01654 res = Ln_(x); 01655 01656 stagprec = stagsave; 01657 res = adjust(res); 01658 01659 return res; 01660 } // ln(...) 01661 01662 lx_interval log2(const lx_interval &x) throw() 01663 { 01664 int stagsave = stagprec, 01665 stagmax = 39; 01666 if (stagprec>stagmax) stagprec = stagmax; 01667 lx_interval res; 01668 01669 res = ln(x)/Ln2_lx_interval(); 01670 stagprec = stagsave; 01671 res = adjust(res); 01672 01673 return res; 01674 } 01675 01676 lx_interval log10(const lx_interval &x) throw() 01677 { 01678 int stagsave = stagprec, 01679 stagmax = 39; 01680 if (stagprec>stagmax) stagprec = stagmax; 01681 lx_interval res; 01682 01683 res = ln(x)/Ln10_lx_interval(); 01684 stagprec = stagsave; 01685 res = adjust(res); 01686 01687 return res; 01688 } 01689 01690 lx_interval Lnp1_(const lx_interval &x) throw() 01691 { 01692 const real r = 1e-7; 01693 lx_interval res; 01694 01695 res = (Inf(x)>-r && Sup(x)<r)? Lnp1(x) : Ln_(1.0+x); 01696 01697 return res; 01698 } // Lnp1_(...) 01699 01700 lx_interval lnp1(const lx_interval &x) throw() 01701 { 01702 int stagsave = stagprec, 01703 stagmax = 39; 01704 if (stagprec>stagmax) stagprec = stagmax; 01705 01706 lx_interval res,a; 01707 01708 if (Inf(x)<= -1) cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF( 01709 "lx_interval lnp1(const lx_interval &)")); 01710 // Now we have: Inf(x)>-1: 01711 real r; 01712 01713 r = expo_RelDiam(li_part(x)); 01714 if (r > -107) // If the rel. diam of x is too great 01715 { // the lnp1 function is calculated at the 01716 // boundary points of the interval x. Thus, the 01717 // inclusion res is: [Inf(res),Sup(a)] 01718 res = lx_interval(Inf(x)); 01719 res = Lnp1_(res); 01720 a = lx_interval(Sup(x)); 01721 a = Lnp1_(a); 01722 res = lx_interval(Inf(res),Sup(a)); 01723 } 01724 else 01725 res = Lnp1_(x); 01726 01727 stagprec = stagsave; 01728 res = adjust(res); 01729 01730 return res; 01731 } 01732 01733 // ------------------------------------------------------------------------- 01734 // --------------------- power function ------------------------------------ 01735 // ------------------------------------------------------------------------- 01736 01737 lx_interval Power_(const lx_interval &x, const real &n) throw() 01738 // Calculates the inclusion of [x]^n for integer values n. 01739 // The rel. diam of x should not be too great. 01740 // This function is only for the internal use! ( power(...) ) 01741 // Blomquist, 11.02.2008; 01742 { 01743 real one(1.0),zhi(2.0),N(n),r; 01744 double dbl; 01745 01746 lx_interval y,neu,X(x); 01747 01748 if (x == one) y = x; 01749 else 01750 if (N == 0.0) y = one; 01751 else 01752 { 01753 if (N == 1) y = x; 01754 else 01755 if (N == 2) y = sqr(x); 01756 else 01757 { 01758 if (N < 0) 01759 { 01760 X = 1.0/X; 01761 N = -N; 01762 } 01763 // Initialisierung 01764 if ( !Is_Integer(N/2) ) 01765 y = X; 01766 else y = one; 01767 neu = sqr(X); // neu = X*X; 01768 do { 01769 dbl = _double(N/zhi); 01770 dbl = std::floor(dbl); 01771 r = (real) dbl; 01772 if ( !Is_Integer( r/2 ) ) 01773 y *= neu; 01774 zhi += zhi; 01775 if (zhi <= N) 01776 neu = sqr(neu); // neu = neu * neu; 01777 } while (zhi <= N); 01778 } 01779 } 01780 01781 return y; 01782 } // Power_() 01783 01784 lx_interval power(const lx_interval &x, const real &n) throw() 01785 { 01786 int stagsave = stagprec, 01787 stagmax = 38; 01788 if ( !(Is_Integer(n)) ) 01789 cxscthrow(REAL_NOT_ALLOWED("lx_interval power(const lx_interval&, const real&)")); 01790 01791 if (stagprec > stagmax) 01792 stagprec = stagmax; 01793 01794 lx_interval res,a; 01795 real r; 01796 01797 r = expo_RelDiam(li_part(x)); 01798 if (r > -107) // If the rel. diam of x is too great 01799 { // the power function is calculated at the 01800 // boundary points of the interval x. Thus, the 01801 // inclusion res is the convex hull of these intervals: 01802 res = lx_interval(Inf(x)); 01803 res = Power_(res,n); 01804 a = lx_interval(Sup(x)); 01805 a = Power_(a,n); 01806 res = res | a; // Konvex hull 01807 } 01808 else 01809 res = Power_(x,n); 01810 01811 stagprec = stagsave; 01812 res = adjust(res); 01813 01814 return res; 01815 } 01816 01817 01818 // -------------------- Exponential Function ----------------------------- 01819 01820 int Poly_N_Exp(const lx_interval &x) 01821 // Calculation of the polynomial degee N: 01822 // Only for internal use in exp function ! 01823 { 01824 lx_interval absx(abs(x)); 01825 int N(0), 01826 m; 01827 real S(-53*StagPrec(x)*ln_N[0]), 01828 c, 01829 D; // S: -53*(precision of x)*ln(2); 01830 01831 m = expo_gr(li_part(absx)); 01832 if (m>-1000000) 01833 { // x != 0: 01834 c = add_real(m,expo(absx))*ln_N[0]; 01835 D = c; // D(0) = m*ln(2); 01836 while (D > S) { 01837 N++; 01838 D = D + c - ln_N[N-1]; 01839 } 01840 } 01841 01842 return N; 01843 } // Poly_N_Exp() 01844 01845 01846 lx_interval Exp_(const lx_interval &x) throw() 01847 { 01848 int ex,n,N; 01849 01850 real m; 01851 lx_interval res(1.0),absx,T; 01852 lx_real S; 01853 01854 absx = abs(x); 01855 ex = expo_gr(li_part(absx)); 01856 if (ex>-1000000) 01857 { // x != 0 01858 if (Sup(x) <= -6243314768166103.0) 01859 res = lx_interval(lx_real(0),lx_real(-Max_Int_R,l_real(minreal))); 01860 else 01861 { 01862 m = add_real(expo(absx),ex); // absx '=' 2^m 01863 n = (int) _double( (9*ln_N[8] + m*ln_N[0])/ln_N[0]); 01864 T = x; 01865 T = adjust(T); 01866 if (n>0) 01867 times2pown(T,-n); // T '=' 10^-9 01868 // T: reduced argument 01869 N = Poly_N_Exp(T); // N: Polynomial degree 01870 // Calculation of the N+1 polynomial coefficients 01871 // Koff[0], ... , Koff[N]: 01872 lx_interval *Koff = new lx_interval[N+1]; 01873 Koff[0] = 1.0; 01874 for (int k=1; k<=N; k++) 01875 Koff[k] = Koff[k-1]/k; 01876 // Horner-evaluation of the polynomial P_N(T): 01877 res = Koff[N]; 01878 for (int k=N-1; k>=0; k--) 01879 res = res*T + Koff[k]; 01880 // Calculation of the absolute approximation error: 01881 Koff[0] = 1.0; 01882 for (int k=1; k<=N+1; k++) 01883 Koff[0] = Koff[0]*k; // Koff[0] = (N+1)! 01884 T = lx_interval( Sup(abs(T)) ); 01885 T = (power(T,N+1)/Koff[0])/(1-T); 01886 // T: Inclusion of the absolute approximation error 01887 S = Sup(T); 01888 res = res + lx_interval(-S,S); // We now considered 01889 // the absolute approximation error of P_N(T). 01890 // the following loop is only used if n = 1,2,3,... 01891 for (int k=1; k<=n; k++) 01892 res = sqr(res); 01893 delete[] Koff; 01894 } 01895 } 01896 return res; 01897 } // Exp_(...) 01898 01899 lx_interval exp(const lx_interval &x) throw() 01900 { 01901 int stagsave = stagprec, 01902 stagmax = 40; 01903 01904 if (stagprec > stagmax) 01905 stagprec = stagmax; 01906 if (stagprec<3) stagprec = 3; 01907 01908 lx_interval res,a; 01909 real r; 01910 01911 if (Sup(x)>6243314768166065.0) 01912 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF( 01913 "lx_interval exp(const lx_interval &x)")); 01914 r = expo_RelDiam(li_part(x)); 01915 if (r > -107) // If the rel. diam of x is too great 01916 { // the exp function is calculated at the 01917 // boundary points of the interval x. Thus, the 01918 // inclusion res is the convex hull of these intervals: 01919 res = lx_interval(Inf(x)); 01920 res = Exp_(res); 01921 a = lx_interval(Sup(x)); 01922 a = Exp_(a); 01923 res = lx_interval(Inf(res),Sup(a)); 01924 } 01925 else 01926 res = Exp_(x); 01927 01928 stagprec = stagsave; 01929 res = adjust(res); 01930 01931 return res; 01932 } // exp() 01933 01934 lx_interval exp2(const lx_interval &x) throw() 01935 { 01936 int stagsave = stagprec, 01937 stagmax = 40; 01938 if (stagprec>stagmax) stagprec = stagmax; 01939 if (stagprec<3) stagprec = 3; 01940 01941 lx_interval res; 01942 res = exp( x*Ln2_lx_interval() ); 01943 01944 stagprec = stagsave; 01945 res = adjust(res); 01946 01947 return res; 01948 } // exp2(...) 01949 01950 lx_interval exp10(const lx_interval &x) throw() 01951 { 01952 int stagsave = stagprec, 01953 stagmax = 40; 01954 if (stagprec>stagmax) stagprec = stagmax; 01955 if (stagprec<3) stagprec = 3; 01956 01957 lx_interval res; 01958 res = exp( x*Ln10_lx_interval() ); 01959 01960 stagprec = stagsave; 01961 res = adjust(res); 01962 01963 return res; 01964 } // exp10(...) 01965 01966 lx_interval pow(const lx_interval &x, const lx_interval &e) throw() 01967 // Calculating an inclusion of x^y; 01968 // If y is an integer value n with 01969 // -9007199254740991.0 <= n <= +9007199254740991.0, 01970 // then power(x,n) is used, otherwise y = exp( e*ln(x) ), Inf(x)>0; 01971 // Blomquist, 03.03.2008; 01972 { 01973 int stagsave = stagprec, 01974 stagmax = 40; 01975 lx_interval y; 01976 lx_real supabse = Sup(abs(e)); 01977 interval z; 01978 real r; 01979 bool fertig(false); 01980 01981 if (point_intv(e)) 01982 if (supabse < Max_Int_R) 01983 { 01984 z = e; 01985 r = Inf(z); 01986 if ( Is_Integer(r) ) 01987 { 01988 if (r==1) y = x; 01989 else 01990 if (r==0) y = 1; 01991 else y = power(x,r); 01992 fertig = true; 01993 } 01994 } 01995 if (!fertig) 01996 { 01997 if (stagprec < stagmax) stagprec++; 01998 else stagprec = stagmax; 01999 y = exp( e*ln(x) ); 02000 stagprec = stagsave; 02001 y = adjust(y); 02002 } 02003 02004 return y; 02005 } // pow(...) 02006 02007 lx_interval xp1_pow_y(const lx_interval &x, const lx_interval &y) throw() 02008 { 02009 int stagsave = stagprec, 02010 stagmax = 40; 02011 if (stagprec>stagmax) stagprec = stagmax; 02012 lx_interval res, su(1.0+x); 02013 02014 if (point_intv(su) && Sup(su) == 1.0) 02015 res = 1.0; 02016 else 02017 if (point_intv(y) && Sup(y) == 1.0) 02018 res = su; 02019 else 02020 if (point_intv(y) && Sup(y) == 0.0) 02021 res = 1.0; 02022 else 02023 { 02024 if (stagprec < stagmax) stagprec++; 02025 else stagprec = stagmax; 02026 res = exp(y*lnp1(x)); 02027 stagprec = stagsave; 02028 res = adjust(res); 02029 } 02030 02031 return res; 02032 } // xp1_pow_y(...) 02033 02034 int Poly_N_Expm1(const lx_interval &x) 02035 // Calculation of the polynomial degee N: 02036 // Only for internal use in Expm1(...) 02037 { 02038 lx_interval absx(abs(x)); 02039 int N(0), m; 02040 real S(-53*stagprec*ln_N[0]), 02041 c, 02042 D; // S: -53*(Praezision von x)*ln(2); 02043 m = expo_gr(li_part(absx)); // Neu 02044 if (m>-1000000) 02045 { 02046 D = m + expo(absx); // Calculation of D is uncritical! 02047 c = D*ln_N[0]; 02048 D = (D-1)*ln_N[0]; // D = (m-1)*ln(2); 02049 while (D > S) 02050 { 02051 N++; 02052 D = D + c - ln_N[N]; 02053 } 02054 } 02055 return N; 02056 } 02057 02058 lx_interval Expm1(const lx_interval &x) 02059 // e^x - 1; |x| <= 1e-7; 02060 // Only for internal use and for 02061 // not too wide intervals! 02062 { 02063 lx_interval res(0),Fak,D; 02064 lx_real S; 02065 int N; 02066 N = Poly_N_Expm1(x); 02067 // Calculation of the (N+1) Taylor coefficients 02068 lx_interval *Koff = new lx_interval[N+1]; 02069 Koff[0] = 1.0; 02070 for (int k=1; k<=N; k++) 02071 Koff[k] = Koff[k-1]/(k+1); 02072 // Evaluation of the Taylor polynimial P_N(x) (Horner) 02073 res = Koff[N]; 02074 for (int k=N-1; k>=0; k--) 02075 res = res*x + Koff[k]; 02076 // Calculation of the absolute approximation error: 02077 Fak = 1.0; 02078 for (int k=1; k<=N+2; k++) 02079 Fak = Fak * k; // Fak = (N+2)! 02080 D = lx_interval( Sup(abs(x)) ); 02081 D = (power(D,N+1)/Fak)/(1-D); // D: inclusion of the absolute 02082 // approximation error; 02083 S = Sup(D); 02084 res = res + lx_interval(-S,S); // Considering the approx. error; 02085 res = res * x; 02086 delete[] Koff; 02087 return res; 02088 } 02089 02090 lx_interval EXPm1(const lx_interval &x) throw() 02091 // e^x - 1; 02092 // Only for internal use and for 02093 // not too wide intervals! 02094 { 02095 int stagsave = stagprec, 02096 stagmax = 40; 02097 lx_interval res; 02098 if (Sup(abs(x))<1e-7) 02099 res = Expm1(x); 02100 else 02101 { 02102 if (stagprec < stagmax) stagprec++; 02103 res = Exp_(x)-1; 02104 } 02105 stagprec = stagsave; 02106 res = adjust(res); 02107 02108 return res; 02109 } // EXPm1(...) 02110 02111 lx_interval expm1(const lx_interval &x) throw() 02112 // e^x - 1; 02113 { 02114 int stagsave = stagprec, 02115 stagmax = 40; 02116 if (stagprec > stagmax) 02117 stagprec = stagmax; 02118 02119 lx_interval res,a; 02120 real r; 02121 02122 r = expo_RelDiam(li_part(x)); 02123 if (r > -107) // If the rel. diam of x is too great 02124 { // the expm1 function is calculated at the 02125 // boundary points of the interval x. Thus, due to 02126 // the monotony, the inclusion is given by: 02127 // res = [Inf(res),Sup(a)]; 02128 res = lx_interval(Inf(x)); 02129 res = EXPm1(res); 02130 a = lx_interval(Sup(x)); 02131 a = EXPm1(a); 02132 res = lx_interval(Inf(res),Sup(a)); 02133 } 02134 else 02135 res = EXPm1(x); 02136 02137 stagprec = stagsave; 02138 res = adjust(res); 02139 02140 return res; 02141 } 02142 02143 // -------------------------- sin(...) -------------------------------------- 02144 02145 real pot3_n[20] = {3.0, 9.0, 27.0, 81.0, 243.0, 729.0, 2187.0, 6561.0, 02146 19683.0, 59049.0, 177147.0, 531441.0, 1594323.0, 4782969.0, 02147 14348907.0, 43046721.0, 129140163.0, 387420489.0, 02148 1162261467.0, 3486784401.0 }; 02149 // pot3_n[k] = 3^(k+1); k = 0,1,2, ... ,19; 02150 // pot3_n[0] = 3.0; ... pot3_n[19] = 3^20 = 3486784401.0; 02151 02152 lx_interval Sin_Rek(const lx_interval &x, int n) 02153 // Only for internal use in sin-function. 02154 { 02155 lx_interval u,v; 02156 u = x; 02157 for (int k=1; k<=n; k++) 02158 { // Rekursion: u = u*(3-4*u^2); 02159 v = sqr(u); 02160 times2pown(v,2); // v = 4*sqr(u); 02161 u = u*(3-v); 02162 } 02163 return u; 02164 } 02165 02166 int Poly_N_Sin(const lx_interval &x) 02167 // Calculation of the polynomial degee N: 02168 // Only for internal use in sin-function. 02169 { 02170 lx_interval absx(abs(x)); 02171 int N(0), 02172 k; 02173 real S(-53*stagprec*ln_N[0]), // S: -53*(actual pecision)*ln(2); 02174 c,kr,D; 02175 02176 k = expo_gr(li_part(absx)); 02177 if (k>-1000000) 02178 { // x != 0 02179 kr = k + expo(absx); 02180 c = (2*kr)*ln_N[0]; 02181 D = c - ln_N[4]; // D = D(0) = 2*kr*ln(2) - ln(3!); 02182 while (D > S) 02183 { 02184 N++; 02185 D = D + c - ln_N[2*N] - ln_N[2*N+1]; // Recursion formula 02186 } 02187 } // N=0 if x==0; 02188 return N; 02189 } 02190 02191 l_real floor(const l_real &x) 02192 // Rounding to the next integer number z, with z <= x; 02193 { 02194 l_real y(x),z(0); 02195 int p(StagPrec(y)),k; 02196 02197 y = y + 0; // Sorting the components. 02198 02199 if (expo(y[1])>-1000000) 02200 // x != 0 02201 { 02202 k=1; 02203 while(expo(y[k])>=53 && k<=p) 02204 { 02205 z += y[k]; // Addition of the integer parts 02206 k++; 02207 } 02208 if (k<=p) 02209 z += std::floor(_double(y[k])); // Addition of the last 02210 } // floor part of y[k]. 02211 02212 return z; 02213 } // floor 02214 02215 lx_interval sin(const lx_interval &x) throw() 02216 // Inclusion of sin(x) 02217 // Blomquist, 11.03.2008; 02218 { 02219 int stagsave = stagprec, 02220 stagmax = 39, 02221 n,N,exl; 02222 const real ln2 = 0.6931471806, 02223 ln10 = 2.302585093, 02224 ln3r = 0.9102392264, // 1/ln(3) 02225 MaxR = 1.71e308, // < MaxReal 02226 pi2 = 6.283185309; // pi2 > 2*pi 02227 l_interval xl; 02228 l_real m; 02229 real r,ex; 02230 interval z; 02231 bool bl(false); 02232 02233 if (stagprec > stagmax) 02234 stagprec = stagmax; 02235 02236 lx_interval res(0.0),T,Pi2; 02237 lx_real S,Si; 02238 02239 if (Sup(abs(x))>MaxR) 02240 res = lx_interval(0,l_interval(-1,1)); 02241 else 02242 if (diam(x)>pi2) // Pi2 > 2*pi; 02243 res = lx_interval(0,l_interval(-1,1)); 02244 else // diam(x) <= 6.283185309 && Sup(abs(x)) <= MaxReal/1.05 02245 { 02246 ex = expo(x); 02247 exl = expo_gr(li_part(x)); 02248 if (exl>-1000000) 02249 { // x != 0 02250 if (ex<-1080-exl) // sin(x) approx x 02251 if (0<=x) 02252 res = x; 02253 else 02254 if (Inf(x)>0) 02255 { 02256 Pi2 = lx_interval(Inf(x)); 02257 T = Pi2 * One_m_lx_interval(); 02258 res = lx_interval(Inf(T),Sup(x)); 02259 } 02260 else 02261 { 02262 Pi2 = lx_interval(Sup(x)); 02263 T = Pi2 * One_m_lx_interval(); 02264 res = lx_interval(Inf(x),Sup(T)); 02265 } 02266 else 02267 { 02268 xl = x; 02269 r = expo_RelDiam(li_part(x)); 02270 if (r > -107) // If the rel. diam of x is too great 02271 { // the sin function is calculated using 02272 // the class l_interval 02273 xl = sin(xl); 02274 res = xl; 02275 } 02276 else 02277 { 02278 Pi2 = Pi_lx_interval(); 02279 times2pown(Pi2,1); // Pi2 = 2*Pi 02280 m = floor( Inf(xl)/Inf(Pi2_l_interval()) ); 02281 T = x - m*Pi2; // T: reduced argument 02282 xl = T; z = xl; 02283 if (diam(z)>Pi2_real) 02284 return lx_interval(0,l_interval(-1,1)); 02285 02286 r = expo( Sup(abs(z)) ); 02287 n = (int) _double((r*ln2 + 8*ln10)*ln3r); 02288 // if (n<=0) then |z|<=10^(-8), 02289 // i.e. a second argument reduction is not necessary! 02290 // A second argument reduction exist <==> n>0. 02291 if (n>0) 02292 T = T / pot3_n[n-1]; // T = T / 3^n; 02293 // T is the reduced argument; 02294 N = Poly_N_Sin(T); // N: Polynomial degree; 02295 02296 // Calculation of the N+1 polynomial coefficients 02297 // Koff[0], ... , Koff[N]: 02298 lx_interval *Koff = new lx_interval[N+1]; 02299 Koff[0] = 1.0; 02300 for (int k=1; k<=N; k++) 02301 { 02302 m = 2*k; 02303 Koff[k] = -Koff[k-1]/(m*(m+1)); 02304 } 02305 // Horner evaluation of the polynomial P_N(T^2): 02306 res = Koff[N]; Pi2 = sqr(T); 02307 for (int k=N-1; k>=0; k--) 02308 res = res*Pi2 + Koff[k]; 02309 // Calculation of the absolute approximation error: 02310 Koff[0] = 1.0; 02311 for (int k=1; k<=N+1; k++) 02312 { 02313 m = 2*k; 02314 Koff[0] = Koff[0]*m*(m+1); 02315 } // Koff[0] = (2N+3)! 02316 Pi2 = lx_interval( Sup(abs(T)) ); 02317 Pi2 = sqr(Pi2); 02318 Pi2 = power(Pi2,N+1)/Koff[0]; 02319 // Pi2: Inclusion of the absolute approx. error 02320 S = Sup(Pi2); 02321 res = res + lx_interval(-S,S); // We now considered 02322 // the absolute approximation error of P_N(T^2). 02323 res = res*T; // res: Inclusion of sin(T/3^n) 02324 // Now calculating an inclusion of sin(T) using 02325 // the recurrence: 02326 res = Sin_Rek(res,n); 02327 delete[] Koff; 02328 } 02329 } 02330 } 02331 } 02332 stagprec = stagsave; // Restore the old stagprec value 02333 res = adjust(res); 02334 S = Sup(res); Si = Inf(res); 02335 if (S>1.0) { S = 1.0; bl = true; } 02336 if (Si<-1.0) { Si = -1.0; bl = true; } 02337 if (bl) 02338 res = lx_interval(Si,S); 02339 // Now -1 <= res <= +1 is guaranteed 02340 02341 return res; 02342 } // sin() 02343 02344 lx_interval sin_n(const lx_interval &x, const real& n) throw() 02345 // Inclusion of sin(n*Pi + x) 02346 { 02347 int stagsave = stagprec, 02348 stagmax = 39; 02349 if (stagprec > stagmax) 02350 stagprec = stagmax; 02351 lx_interval res; 02352 02353 if ( !(Is_Integer(n)) ) 02354 cxscthrow(REAL_NOT_ALLOWED("lx_interval sin_n(const lx_interval&, const real&)")); 02355 02356 res = sin(x); 02357 // if (n%2 != 0) res = -res; 02358 if ( !(Is_Integer(n/2)) ) 02359 res = -res; 02360 02361 stagprec = stagsave; // Restore the old stagprec value 02362 res = adjust(res); 02363 02364 return res; 02365 } // sin_n(...) 02366 02367 lx_interval cos(const lx_interval &x) throw() 02368 // Inclusion of cos(x) 02369 { 02370 int stagsave = stagprec, 02371 stagmax = 39; 02372 if (stagprec > stagmax) 02373 stagprec = stagmax; 02374 lx_interval res; 02375 lx_real S,Si; 02376 bool bl(false); 02377 02378 if (li_part(x)==0) res = 1.0; 02379 else 02380 { 02381 res = Pi_lx_interval(); 02382 times2pown(res,-1); // res = Pi/2; 02383 res = x + res; 02384 res = sin(res); 02385 } 02386 02387 stagprec = stagsave; // Restore the old stagprec value 02388 res = adjust(res); 02389 02390 S = Sup(res); Si = Inf(res); 02391 if (S>1.0) { S = 1.0; bl = true; } 02392 if (Si<-1.0) { Si = -1.0; bl = true; } 02393 if (bl) 02394 res = lx_interval(Si,S); 02395 // Now -1 <= res <= +1 is realized 02396 02397 return res; 02398 } // cos(...) 02399 02400 lx_interval cos_n(const lx_interval &x, const real& n) throw() 02401 // Inclusion of cos((n+0.5)*Pi + x) 02402 { 02403 int stagsave = stagprec, 02404 stagmax = 39; 02405 if (stagprec > stagmax) 02406 stagprec = stagmax; 02407 lx_interval res; 02408 02409 if ( !(Is_Integer(n)) ) 02410 cxscthrow(REAL_NOT_ALLOWED("lx_interval cos_n(const lx_interval&, const real&)")); 02411 res = sin(x); 02412 // if (n%2 == 0) res = -res; 02413 if ( (Is_Integer(n/2)) ) 02414 res = -res; 02415 02416 stagprec = stagsave; // Restore the old stagprec value 02417 res = adjust(res); 02418 02419 return res; 02420 } // cos_n(...) 02421 02422 lx_interval tan(const lx_interval& x) throw() 02423 { 02424 lx_interval c,y; 02425 02426 if (li_part(x) == 0) 02427 y = lx_interval(0,l_interval(0.0)); 02428 else 02429 { 02430 c = cos(x); 02431 if (0.0 <= c) 02432 { 02433 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF("lx_interval tan(const lx_interval &x)")); 02434 } 02435 y = sin(x)/c; 02436 } 02437 return y; 02438 } // tan() 02439 02440 lx_interval cot(const lx_interval & x) throw() 02441 { 02442 lx_interval s,y; 02443 02444 s = sin(x); 02445 if (0.0 <= s) 02446 { 02447 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF("lx_interval cot(const lx_interval &x)")); 02448 } 02449 y = cos(x)/s; 02450 02451 return y; 02452 } // cot() 02453 02454 lx_interval sqrt1px2(const lx_interval &x) throw() 02455 { // Inclusion of sqrt(1+x^2) 02456 int ext,c(3210); 02457 real ex; 02458 lx_interval y(abs(x)); 02459 ext = expo_gr(li_part(y)); 02460 ex = expo(y); 02461 02462 if (ext>-1000000 && ex>c) 02463 y = lx_interval(Inf(x),upper_bnd(Sup(x))); 02464 else 02465 if (ext<-1000000) 02466 y = lx_interval(0,l_interval(1)); 02467 else // x != 0; 02468 y = (ex<-c)? 1.0 + lx_interval(lx_real(0),Sup(y)) : sqrt(1+sqr(y)); 02469 02470 return y; 02471 } // sqrt1px2() 02472 02473 int Poly_N_Atan(const lx_interval &x) 02474 // Calculation of the polynomial degee N: 02475 // Only for the internal use in the Atan_-function. 02476 { 02477 lx_interval absx(abs(x)); 02478 int N(0), 02479 ex; 02480 real S(-53*stagprec*ln_N[0]), // S: -53*(actual precision)*ln(2); 02481 c,D; 02482 ex = expo_gr(li_part(absx)); 02483 if (ex>-1000000) 02484 { // x != 0 02485 D = ex + expo(absx); // Calculation of D is uncritical! 02486 c = D*ln_N[0]; 02487 D = 2*D*ln_N[0] - ln_N[1]; // D = D(0) = 2ex*ln(2)-ln(3); 02488 while (D > S) { 02489 N++; 02490 D = (2*N+2)*c - ln_N[2*N+1]; 02491 } 02492 } // N=0 if x==0; 02493 return N; 02494 } // Poly_N_Atan() 02495 02496 lx_interval Atan_(const lx_interval &x) throw() 02497 // Inclusion of atan(x) for rather tight intervals x only! 02498 // Only for the internal use in atan(x)! 02499 { 02500 const int c(4); 02501 int exl, m(0), N; 02502 real ex(expo(x)); 02503 02504 lx_interval res(0.0),T,T2; 02505 l_interval xl(li_part(x)); 02506 bool neg; 02507 lx_real Xl; 02508 02509 exl = expo_gr(xl); 02510 if (exl>-100000) 02511 { // x != 0 02512 res = x; 02513 if ( abs(Inf(res))>lx_real(2092,8.567562) ) 02514 { 02515 neg = Sup(xl)<0; 02516 res = Pi_lx_interval(); 02517 times2pown(res,-1); // Pi/2 enclosed by res; 02518 if (neg) res = -res; 02519 } 02520 else 02521 if (ex<-1080-exl) // atan(x) approx x 02522 if (Inf(x)>0) 02523 { 02524 T2 = lx_interval(Inf(x)); 02525 T = T2 * One_m_lx_interval(); 02526 res = lx_interval(Inf(T),Sup(x)); 02527 } 02528 else // Sup(x)<0, because x is a rather tight interval 02529 { 02530 T2 = lx_interval(Sup(x)); 02531 T = T2 * One_m_lx_interval(); 02532 res = lx_interval(Inf(x),Sup(T)); 02533 } 02534 else 02535 { // Now with argument reduction (Rothmaier) 02536 ex = ex + exl; 02537 if (ex>1) 02538 m = (int) _double( (ln_N[0]+c*ln_N[8])/ln_N[0] ); 02539 else 02540 if (ex>-10000) 02541 m = (int) _double((c*ln_N[8] + ex*ln_N[0])/ln_N[0]); 02542 T = x; 02543 // Now with m >= 0 transformations: 02544 for (int k=1; k<=m; k++) 02545 T = T /(1 + sqrt1px2(T)); // T: reduced argument 02546 // Now calculating the polynomial degree: 02547 N = Poly_N_Atan(T); 02548 // Calculation of the N+1 polynomial coefficients 02549 // Koff[0], ... , Koff[N]: 02550 lx_interval *Koff = new lx_interval[N+1]; 02551 Koff[0] = 1.0; 02552 for (int k=1; k<=N; k++) 02553 { 02554 Koff[k] = lx_interval(0,l_interval(1))/ (2*k+1); 02555 if (k%2 != 0) Koff[k] = -Koff[k]; 02556 } 02557 // Horner-evaluation of the polynomial P_N(T2): 02558 res = Koff[N]; 02559 T2 = sqr(T); 02560 for (int k=N-1; k>=0; k--) 02561 res = res*T2 + Koff[k]; // res = P_N(T2) 02562 // Calculation of the absolute approximation error: 02563 T2 = lx_interval( Sup(abs(T)) ); 02564 T2 = sqr(T2); 02565 T2 = power(T2,N+1)/(2*N+3); 02566 // T2: Inclusion of the absolute approximation error 02567 // Implementing the approximation error: 02568 Xl = Sup(T2); 02569 res += lx_interval(-Xl,Xl); 02570 res = T*res; 02571 if (m>0) times2pown(res,m); 02572 delete[] Koff; 02573 } 02574 } 02575 02576 return res; 02577 } // Atan_() 02578 02579 lx_interval atan(const lx_interval &x) throw() 02580 { 02581 int stagsave = stagprec, 02582 stagmax = 39; 02583 02584 if (stagprec > stagmax) 02585 stagprec = stagmax; 02586 02587 lx_interval res,a; 02588 real r; 02589 02590 r = expo_RelDiam(li_part(x)); 02591 if (r > -107) // If the rel. diam of x is too great 02592 { // the atan function is calculated at the 02593 // boundary points of the interval x. Thus, the 02594 // inclusion res is the convex hull of these intervals: 02595 res = lx_interval(Inf(x)); 02596 res = Atan_(res); 02597 a = lx_interval(Sup(x)); 02598 a = Atan_(a); 02599 res = lx_interval(Inf(res),Sup(a)); 02600 } 02601 else 02602 res = Atan_(x); 02603 02604 stagprec = stagsave; 02605 res = adjust(res); 02606 02607 return res; 02608 } // atan() 02609 02610 // ---------------------- sqrt(1-x^2) ----------------------------------- 02611 02612 lx_interval Sqrt1mx2_(const lx_interval &x) throw() 02613 // Inclusion of sqrt(1-x^2) for rather tight intervals x; 02614 // For the internal use only!! 02615 // Blomquist, 08.04.2008; 02616 { 02617 int exl; 02618 02619 lx_interval res(1); 02620 l_interval li(li_part(x)); 02621 real ex(expo(x)); 02622 02623 exl = expo_gr(li); 02624 if (exl>-100000) 02625 { // x != 0 02626 if (ex<=-2098-exl) 02627 { // Construction of the inclusion 02628 // interval [1 - 2^-2097,1], only possible if p>=2; 02629 res = lx_interval(-1023,l_interval(comp(0.5,1024))); 02630 li = li_part(res); 02631 li += 0; // To get the actual precision and sorting the li[k]; 02632 li[StagPrec(li)] = -minreal; // minreal = 2^-1074; 02633 res = lx_interval(-1023,li); 02634 // res = 2^-1023*[2^1023 - 2^-1074,2^1023] = [1-2^-2097,1]; 02635 } 02636 else 02637 res = (ex>=-exl)? sqrt( (1-x)*(1+x) ) : sqrt( 1-sqr(x) ); 02638 } 02639 return res; 02640 } // Sqrt(1-x^2) 02641 02642 lx_interval sqrt1mx2(const lx_interval &x) throw() 02643 { 02644 int stagsave = stagprec, 02645 stagmax = 39; 02646 02647 if (stagprec > stagmax) stagprec = stagmax; 02648 if (stagprec==1) stagprec++; // stagprec >= 2; 02649 02650 lx_interval res(abs(x)),a; 02651 real r; 02652 02653 r = expo_RelDiam(li_part(res)); 02654 if (r > -107) // If the rel. diam of x is too great 02655 { // the sqrt1mx2 function is calculated at the 02656 // boundary points of the interval x. Thus, the 02657 // inclusion res is the convex hull of these intervals: 02658 a = lx_interval(Inf(res)); 02659 a = Sqrt1mx2_(a); 02660 02661 res = lx_interval(Sup(res)); 02662 res = Sqrt1mx2_(res); 02663 02664 res = lx_interval(Inf(res),Sup(a)); 02665 } 02666 else 02667 res = Sqrt1mx2_(res); 02668 02669 stagprec = stagsave; 02670 res = adjust(res); 02671 02672 return res; 02673 } // sqrt1mx2 02674 02675 // ------------------- sqrt(x^2-1) ------------------------------------ 02676 02677 lx_interval sqrtx2m1(const lx_interval &x) throw() 02678 // Inclusion of sqrt(x^2-1) 02679 // Blomquist, 22.04.08; 02680 { 02681 int stagsave = stagprec, 02682 stagmax = 39; 02683 real ex(expo(x)); 02684 if (stagprec>stagmax) stagprec = stagmax; 02685 02686 lx_interval u(abs(x)),res; 02687 l_interval li(li_part(u)); 02688 lx_real Infu(Inf(u)); 02689 02690 if (Infu < 1) 02691 { 02692 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF( 02693 "lx_interval sqrtx2m1(const lx_interval &x)")); 02694 } 02695 // Now: Inf(u) >= 1; 02696 if (ex > 1604-expo_gr(li)) 02697 res = u + lx_interval(lx_real(-1),lx_real(0)); 02698 else 02699 { 02700 res = sqrt( (u-1)*(u+1) ); 02701 if (Inf(res)<=0 && Infu>1) 02702 { 02703 u = lx_interval(Infu); 02704 u = u + 1; 02705 times2pown(u,-2097); 02706 u = sqrt(u); 02707 res = lx_interval( Inf(u), Sup(res) ); 02708 } 02709 } 02710 02711 stagprec = stagsave; 02712 res = adjust(res); 02713 02714 return res; 02715 } // sqrt(x^2-1) 02716 02717 // ------------------- asin(x) ---------------------------------------- 02718 02719 lx_interval Asin_(const lx_interval& x) throw() 02720 // Inclusion of asin(x) for rather tight intervals x only! 02721 // Only for the internal use in asin(x)! 02722 { 02723 lx_interval y,pihalbe,h; 02724 bool neg; 02725 02726 l_interval xl; 02727 interval z; 02728 xl = x; 02729 z = xl; 02730 02731 real supabsz = Sup(abs(z)), 02732 infz = Inf(z), 02733 supz = Sup(z); 02734 02735 pihalbe = Pi_lx_interval(); 02736 times2pown(pihalbe,-1); // pihalbe = pi/2; 02737 02738 if (infz == supz && supz == 0) 02739 y = 0; 02740 else 02741 if (infz == supz && supabsz == 1) 02742 { 02743 if (supz == 1.0) 02744 y = pihalbe; 02745 else y = -pihalbe; 02746 } 02747 else 02748 { 02749 if (0<=z) 02750 y = atan(x/sqrt1mx2(x)); 02751 else 02752 { 02753 y = x; 02754 neg = Sup(z)<0; 02755 if (neg) y = -y; 02756 if (supabsz < 0.75) 02757 y = atan(y/sqrt1mx2(y)); 02758 else 02759 y = pihalbe - atan(sqrt1mx2(y)/y); 02760 if (neg) y = -y; 02761 } 02762 } 02763 02764 return y; 02765 } // Asin_(x) 02766 02767 lx_interval asin(const lx_interval &x) throw() 02768 { 02769 int stagsave = stagprec, 02770 stagmax = 39; 02771 02772 if (stagprec > stagmax) 02773 stagprec = stagmax; 02774 02775 lx_interval res,a; 02776 real r; 02777 02778 if (Inf(x)<-1 || Sup(x)>1) 02779 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 02780 ("lx_interval asin(const lx_interval& x)")); 02781 02782 r = expo_RelDiam(li_part(x)); 02783 if (r > -107) // If the rel. diam of x is too great 02784 { // the asin function is calculated at the 02785 // boundary points of the interval x. Thus, the 02786 // inclusion res is the convex hull of these intervals: 02787 res = lx_interval(Inf(x)); 02788 res = Asin_(res); 02789 a = lx_interval(Sup(x)); 02790 a = Asin_(a); 02791 res = lx_interval(Inf(res),Sup(a)); 02792 } 02793 else 02794 res = Asin_(x); 02795 02796 stagprec = stagsave; 02797 res = adjust(res); 02798 02799 return res; 02800 } // asin() 02801 02802 // ------------------- acos(x) ---------------------------------------- 02803 02804 lx_interval Acos_(const lx_interval& x) throw() 02805 // Inclusion of acos(x) for rather tight intervals x only! 02806 // Only for the internal use in acos(x)! 02807 // Blomquist, 24.04.2008; 02808 { 02809 lx_interval y,pihalbe,pi; 02810 bool neg; 02811 l_interval xl; 02812 interval z; 02813 02814 xl = x; 02815 z = xl; 02816 02817 real supabsz = Sup(abs(z)), 02818 infz = Inf(z), 02819 supz = Sup(z); 02820 02821 pi = Pi_lx_interval(); 02822 pihalbe = pi; 02823 times2pown(pihalbe,-1); // pihalbe = pi/2; 02824 02825 if (infz == supz && supz == 0) 02826 y = pihalbe; 02827 else 02828 if (infz == supz && supabsz == 1) 02829 { 02830 if (supz == 1.0) 02831 y = 0; 02832 else y = pi; 02833 } 02834 else 02835 { 02836 if (0<=z) 02837 y = pihalbe - atan(x/sqrt1mx2(x)); 02838 else 02839 { 02840 y = x; 02841 neg = Sup(z)<0; 02842 if (neg) y = -y; 02843 if (supabsz < 0.25) 02844 y = pihalbe - atan(y/sqrt1mx2(y)); 02845 else 02846 y = atan(sqrt1mx2(y)/y); 02847 if (neg) y = pi - y; 02848 } 02849 } 02850 02851 return y; 02852 } // Acos_(x) 02853 02854 lx_interval acos(const lx_interval &x) throw() 02855 // Blomquist, 24.04.2008; 02856 { 02857 int stagsave = stagprec, 02858 stagmax = 39; 02859 02860 if (stagprec > stagmax) 02861 stagprec = stagmax; 02862 02863 lx_interval res,a; 02864 real r; 02865 02866 if (Inf(x)<-1 || Sup(x)>1) 02867 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 02868 ("lx_interval acos(const lx_interval& x)")); 02869 02870 r = expo_RelDiam(li_part(x)); 02871 if (r > -107) // If the rel. diam of x is too great 02872 { // the acos function is calculated at the 02873 // boundary points of the interval x. Thus, the 02874 // inclusion res is the convex hull of these intervals: 02875 res = lx_interval(Inf(x)); 02876 res = Acos_(res); 02877 a = lx_interval(Sup(x)); 02878 a = Acos_(a); 02879 res = lx_interval(Inf(a),Sup(res)); 02880 } 02881 else 02882 res = Acos_(x); 02883 02884 stagprec = stagsave; 02885 res = adjust(res); 02886 02887 return res; 02888 } // acos() 02889 02890 02891 // ------------------- acot(x) ---------------------------------------- 02892 02893 lx_interval Acot_(const lx_interval& x) throw() 02894 // codomain of acot(x): (0,pi); 02895 // acot(x) is continuous at x=0; 02896 // Blomquist, 25.04.2008; 02897 { 02898 int exl; 02899 real ex(expo(x)); 02900 lx_interval y,pihalbe,pi; 02901 bool neg; 02902 02903 l_interval xl(li_part(x)); 02904 exl = expo_gr(xl); 02905 02906 pi = Pi_lx_interval(); 02907 pihalbe = pi; 02908 times2pown(pihalbe,-1); // pihalbe = pi/2; 02909 02910 if (0<=xl) 02911 y = pihalbe - atan(x); 02912 else 02913 { 02914 y = x; 02915 neg = Sup(xl) < 0; 02916 if (neg) y = -y; 02917 if (ex<=-exl) 02918 if (ex<-exl-1580) 02919 y = pihalbe; 02920 else 02921 y = pihalbe - atan(y); 02922 else y = atan(1/y); 02923 if (neg) y = pi - y; 02924 } 02925 02926 return y; 02927 } // Acot_(x) 02928 02929 lx_interval acot(const lx_interval &x) throw() 02930 // Blomquist, 24.04.2008; 02931 { 02932 int stagsave = stagprec, 02933 stagmax = 39; 02934 02935 if (stagprec > stagmax) 02936 stagprec = stagmax; 02937 02938 lx_interval res,a; 02939 real r; 02940 02941 r = expo_RelDiam(li_part(x)); 02942 if (r > -107) // If the rel. diam of x is too great 02943 { // the acot function is calculated at the 02944 // boundary points of the interval x. Thus, the 02945 // inclusion res is the convex hull of these intervals: 02946 res = lx_interval(Inf(x)); 02947 res = Acot_(res); 02948 a = lx_interval(Sup(x)); 02949 a = Acot_(a); 02950 res = lx_interval(Inf(a),Sup(res)); 02951 } 02952 else 02953 res = Acot_(x); 02954 02955 stagprec = stagsave; 02956 res = adjust(res); 02957 02958 return res; 02959 } // acot() 02960 02961 // -------------------------- sinh(...) -------------------------------------- 02962 02963 lx_interval Sinh_(const lx_interval &x) throw() 02964 // Inclusion of sinh(x) for sufficiently tight intervals x 02965 { 02966 int exl; 02967 real ex; 02968 lx_interval res(0.0),T; 02969 l_interval xl(li_part(x)); 02970 bool neg; 02971 02972 ex = expo(x); 02973 exl = expo_gr(xl); 02974 02975 if (0<=xl) // Null in x enthalten! 02976 { 02977 T = expm1(-x); 02978 res = -T*(1+1/(T+1)); 02979 times2pown(res,-1); 02980 } 02981 else // Null ist nicht in x enthalten! 02982 if (ex<=-exl) 02983 { // |abs(x)| < 1; 02984 T = expm1(-x); 02985 res = -T*(1+1/(T+1)); 02986 times2pown(res,-1); 02987 } 02988 else 02989 { // |abs(x)| >= 1; 02990 T = x; 02991 neg = Inf(xl)<0; 02992 if (neg) T = -T; 02993 02994 if (ex>12-exl) 02995 { 02996 res = exp(T); 02997 times2pown(res,-1); 02998 res += l_interval(-0.5,0); 02999 } 03000 else 03001 { 03002 res = exp(T); 03003 res = res - 1/res; 03004 times2pown(res,-1); 03005 } 03006 if (neg) res = -res; 03007 } 03008 03009 return res; 03010 } // Sinh_(...) 03011 03012 lx_interval sinh(const lx_interval &x) throw() 03013 { 03014 int stagsave = stagprec, 03015 stagmax = 39; 03016 03017 if (stagprec > stagmax) 03018 stagprec = stagmax; 03019 03020 lx_interval res,a; 03021 real r; 03022 03023 r = expo_RelDiam(li_part(x)); 03024 if (r > -107) // If the rel. diam of x is too great 03025 { // the sinh function is calculated at the 03026 // boundary points of the interval x. Thus, the 03027 // inclusion res is the convex hull of these intervals: 03028 res = lx_interval(Inf(x)); 03029 res = Sinh_(res); 03030 a = lx_interval(Sup(x)); 03031 a = Sinh_(a); 03032 res = lx_interval(Inf(res),Sup(a)); 03033 } 03034 else 03035 res = Sinh_(x); 03036 03037 stagprec = stagsave; 03038 res = adjust(res); 03039 03040 return res; 03041 } // sinh() 03042 03043 // -------------------------- cosh(...) ------------------------------------ 03044 03045 lx_interval Cosh_(const lx_interval& x) throw() 03046 // codomain of cosh(x): [1,+infty); 03047 // This function is only used for tight intervals x, 03048 // with Inf(x)>=0; 03049 // Blomquist, 26.04.2008; 03050 { 03051 lx_interval y; 03052 lx_real Si; 03053 l_interval xl; 03054 interval z; 03055 03056 xl = x; 03057 z = xl; 03058 03059 y = exp(x); 03060 if (Inf(z)>4096) 03061 { 03062 times2pown(y,-1); 03063 y += l_interval(0,0.5); 03064 } 03065 else 03066 { 03067 y = y + 1/y; 03068 times2pown(y,-1); 03069 } 03070 Si = Inf(y); 03071 if (Si<1.0) y = lx_interval(lx_real(1.0),Sup(y)); 03072 03073 return y; 03074 } // Cosh_(x) 03075 03076 lx_interval cosh(const lx_interval &x) throw() 03077 { 03078 int stagsave = stagprec, 03079 stagmax = 39; 03080 03081 if (stagprec > stagmax) 03082 stagprec = stagmax; 03083 03084 lx_interval res,a,y(abs(x)); 03085 real r; 03086 03087 r = expo_RelDiam(li_part(y)); 03088 if (r > -107) // If the rel. diam of x is too great 03089 { // the cosh function is calculated at the 03090 // boundary points of the interval x. Thus, the 03091 // inclusion res is the convex hull of these intervals: 03092 res = lx_interval(Inf(y)); 03093 res = Cosh_(res); 03094 a = lx_interval(Sup(y)); 03095 a = Cosh_(a); 03096 res = lx_interval(Inf(res),Sup(a)); 03097 } 03098 else 03099 res = Cosh_(y); 03100 03101 stagprec = stagsave; 03102 res = adjust(res); 03103 03104 return res; 03105 } // cosh() 03106 03107 // -------------------------- tanh(...) ------------------------------------ 03108 03109 lx_interval Tanh_(const lx_interval& x) throw() 03110 { 03111 // Blomquist, 27.04.2008; 03112 int exl; 03113 real ex(expo(x)); 03114 lx_interval y(x),t; 03115 lx_real Iy; 03116 bool neg; 03117 l_interval xl(li_part(x)); 03118 exl = expo_gr(xl); 03119 03120 if (0<=xl) 03121 { 03122 times2pown(y,1); // y = 2x; 03123 y = expm1(-y); // y = exp(-2x) - 1; 03124 y = -y/(2+y); 03125 } 03126 else 03127 { // 0 not included by x. 03128 if (ex<=-exl) // 0<|x|<1; 03129 { 03130 times2pown(y,1); // y = 2x; 03131 y = expm1(-y); // y = exp(-2x) - 1; 03132 y = -y/(2+y); 03133 } 03134 else 03135 { // |x| >= 1; 03136 neg = Sup(xl)<0; 03137 if (neg) y = -y; // Inf(y)>0, bzw. y = abs(x); 03138 Iy = Inf(y); 03139 ex = expo(Iy); exl = expo_gr(lr_part(Iy)); 03140 if (ex >= -exl+13) 03141 y = lx_interval(Inf(One_m_lx_interval()),lx_real(1)); 03142 else 03143 { 03144 times2pown(y,1); // y = 2x; 03145 y = exp(-y); // y = exp(-2x); 03146 y = (1-y) / (1+y); 03147 } 03148 if (neg) y = - y; 03149 } 03150 } 03151 03152 return y; 03153 } // Tanh_(x) 03154 03155 lx_interval tanh(const lx_interval &x) throw() 03156 { 03157 int stagsave = stagprec, 03158 stagmax = 39; 03159 03160 if (stagprec > stagmax) 03161 stagprec = stagmax; 03162 03163 lx_interval res,a; 03164 real r; 03165 03166 r = expo_RelDiam(li_part(x)); 03167 if (r > -107) // If the rel. diam of x is too great 03168 { // the tanh function is calculated at the 03169 // boundary points of the interval x. Thus, the 03170 // inclusion res is the convex hull of these intervals: 03171 res = lx_interval(Inf(x)); 03172 res = Tanh_(res); 03173 a = lx_interval(Sup(x)); 03174 a = Tanh_(a); 03175 res = lx_interval(Inf(res),Sup(a)); 03176 } 03177 else 03178 res = Tanh_(x); 03179 03180 stagprec = stagsave; 03181 res = adjust(res); 03182 03183 return res; 03184 } // tanh() 03185 03186 // -------------------------- coth(...) ------------------------------------ 03187 03188 lx_interval Coth_(const lx_interval& x) throw() 03189 // This function is only used for tight intervals x, 03190 // with Inf(x) > 0; 03191 // Blomquist, 27.04.2008; 03192 { 03193 int exl; 03194 lx_interval y(x); 03195 real ex(expo(x)); 03196 lx_real Iy; 03197 l_interval xl(li_part(x)); 03198 03199 exl = expo_gr(xl); 03200 03201 if (ex<=-exl) // 0<|x|<1; 03202 { 03203 times2pown(y,1); // y = 2x; 03204 y = expm1(-y); // y = exp(-2x) - 1; 03205 y = -(2+y)/y; 03206 } 03207 else 03208 { // |x| >= 1; 03209 Iy = Inf(y); 03210 ex = expo(Iy); exl = expo_gr(lr_part(Iy)); 03211 03212 if (ex>=-exl+13) 03213 y = lx_interval(lx_real(1),Sup(One_p_lx_interval())); 03214 else 03215 { 03216 times2pown(y,1); // y = 2x; 03217 y = exp(-y); // y = exp(-2x); 03218 y = (1+y) / (1-y); 03219 } 03220 } 03221 03222 return y; 03223 } // coth(x) 03224 03225 lx_interval coth(const lx_interval &x) throw() 03226 // Blomquist, 27.04.2008; 03227 { 03228 int stagsave = stagprec, 03229 stagmax = 39; 03230 03231 if (stagprec > stagmax) 03232 stagprec = stagmax; 03233 03234 l_interval xl(li_part(x)); 03235 if (0<=xl) 03236 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03237 ("lx_interval coth(const lx_interval& x)")); 03238 03239 lx_interval res,a,y(x); 03240 real r; 03241 bool neg(Sup(xl)<0); 03242 03243 if (neg) y = -y; // Inf(y)>0; 03244 03245 r = expo_RelDiam(xl); 03246 if (r > -107) // If the rel. diam of x is too great 03247 { // the coth function is calculated at the 03248 // boundary points of the interval x. Thus, the 03249 // inclusion res is the convex hull of these intervals: 03250 res = lx_interval(Inf(y)); 03251 res = Coth_(res); 03252 a = lx_interval(Sup(y)); 03253 a = Coth_(a); 03254 res = lx_interval(Inf(a),Sup(res)); 03255 } 03256 else 03257 res = Coth_(y); 03258 if (neg) res = -res; 03259 03260 stagprec = stagsave; 03261 res = adjust(res); 03262 03263 return res; 03264 } // coth() 03265 03266 // -------------------------- sqrt(1+x)-1 ------------------------------------ 03267 03268 lx_interval Sqrtp1m1_(const lx_interval& x) throw() 03269 // sqrtp1m1(x) calculates an inclusion of sqrt(x+1)-1; 03270 // Blomquist, 25.08.07; 03271 { 03272 int exl; 03273 lx_interval y(0),tmp; 03274 l_interval xl(li_part(x)); 03275 interval z; 03276 real ex(expo(x)); 03277 const real c = 0.1; 03278 03279 exl = expo_gr(xl); 03280 if (exl>-1000000) // x != 0; 03281 { 03282 if (ex>-exl+500) 03283 y = sqrt(1+x) - 1; 03284 else 03285 { 03286 xl = x; // xl is an inclusion of x, 03287 z = xl; // and z is an inclusion of x; 03288 tmp = x+1; 03289 y = (z<=interval(-c,c))? x/(sqrt(tmp)+1) : sqrt(tmp)-1; 03290 } 03291 } 03292 03293 return y; 03294 } // Sqrtp1m1_ 03295 03296 lx_interval sqrtp1m1(const lx_interval &x) throw() 03297 { 03298 int stagsave = stagprec, 03299 stagmax = 30; 03300 03301 stagprec++; 03302 if (stagprec>stagmax) stagprec = stagmax; 03303 03304 lx_interval res,a; 03305 real r; 03306 03307 r = expo_RelDiam(li_part(x)); 03308 if (r > -107) // If the rel. diam of x is too great 03309 { // the sqrtp1m1 function is calculated at the 03310 // boundary points of the interval x. Thus, the 03311 // inclusion res is the convex hull of these intervals: 03312 res = lx_interval(Inf(x)); 03313 res = Sqrtp1m1_(res); 03314 a = lx_interval(Sup(x)); 03315 a = Sqrtp1m1_(a); 03316 res = lx_interval(Inf(res),Sup(a)); 03317 } 03318 else 03319 res = Sqrtp1m1_(x); 03320 03321 stagprec = stagsave; 03322 res = adjust(res); 03323 03324 return res; 03325 } // sqrtp1m1() 03326 03327 03328 // -------------------------- asinh(x) ------------------------------------ 03329 03330 lx_interval Asinh_(const lx_interval &x) throw() 03331 // Inclusion of asinh(x) 03332 { 03333 int exl; 03334 lx_interval res,u; 03335 lx_real S1,S2; 03336 l_interval xl(li_part(x)); 03337 interval z; 03338 real ex; 03339 bool neg; 03340 03341 ex = expo(x); 03342 exl = expo_gr(xl); 03343 03344 if (0<=xl) // Null in x enthalten! 03345 { 03346 xl = x; // Falls hier Fehlermeldung, ist das OK, 03347 z = xl; // denn sonst ist x viel zu breit!! 03348 res = asinh(z); // Bis hier OK!!! 03349 } 03350 else // Null ist nicht in x enthalten! 03351 { 03352 neg = (Inf(xl)<0); 03353 u = (neg)? -x : x; // Inf(u)>0 03354 if (ex<=-exl-790) 03355 { 03356 std::cout << "Hallo: (1-u)*(1+u)*res" << std::endl; 03357 res = u; 03358 S2 = Sup(res); 03359 S1 = Inf( (1-u)*(1+u)*res ); 03360 res = lx_interval(S1,S2); 03361 } 03362 else 03363 res = (ex<=-exl)? lnp1(u+sqrtp1m1(sqr(u))) : ln(u+sqrt1px2(u)); 03364 03365 if (neg) res = -res; 03366 } 03367 03368 return res; 03369 } // Asinh_(...) 03370 03371 lx_interval asinh(const lx_interval &x) throw() 03372 { 03373 int stagsave = stagprec, 03374 stagmax = 39; 03375 if (stagprec>stagmax) 03376 stagprec = stagmax; 03377 03378 lx_interval res,a; 03379 real r; 03380 03381 r = expo_RelDiam(li_part(x)); 03382 if (r > -107) // If the rel. diam of x is too great 03383 { // the asinh function is calculated at the 03384 // boundary points of the interval x. Thus, the 03385 // inclusion res is the convex hull of these intervals: 03386 res = lx_interval(Inf(x)); 03387 res = Asinh_(res); 03388 a = lx_interval(Sup(x)); 03389 a = Asinh_(a); 03390 res = lx_interval(Inf(res),Sup(a)); 03391 } 03392 else 03393 res = Asinh_(x); 03394 stagprec = stagsave; 03395 res = adjust(res); 03396 03397 return res; 03398 } // asinh() 03399 03400 // -------------------------- acosh(...) ------------------------------- 03401 03402 lx_interval acosh(const lx_interval &x) throw() 03403 // Inclusion of acosh(x) 03404 { 03405 int stagsave = stagprec, 03406 stagmax = 39, 03407 exl; 03408 if (stagprec > stagmax) 03409 stagprec = stagmax; 03410 lx_interval res(0.0),x_1; 03411 lx_real S1,S2; 03412 real ex; 03413 03414 if (Inf(x)<1) 03415 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03416 ("lx_interval acosh(const lx_interval& x)")); 03417 x_1 = x-1; 03418 ex = expo(x_1); 03419 l_interval x_1l(li_part(x_1)); 03420 exl = expo_gr(x_1l); 03421 03422 if (exl>-100000) // x != [0,0] 03423 { 03424 if (ex <= -exl-1600) 03425 { 03426 res = x; 03427 times2pown(res,1); // res = 2x; 03428 res = sqrt(res - 2); // res = sqrt(2x - 2); 03429 S2 = Sup(res); 03430 res = res * (2-x); // Dieser Trick spart Division durch 12 !! 03431 S1 = Inf(res); 03432 res = lx_interval(S1,S2); 03433 } 03434 else 03435 res = (ex<=-exl)? lnp1( x_1 + sqrt(x_1*(2+x_1)) ) : 03436 ln( x+sqrtx2m1(x) ); 03437 } 03438 stagprec = stagsave; // Restore the old stagprec value 03439 res = adjust(res); 03440 03441 return res; 03442 } // acosh(...) 03443 03444 // ------------------------- acoshp1(...) ----------------------------- 03445 03446 lx_interval Acoshp1_(const lx_interval &x) throw() 03447 // This function is only used for tight intervals x, 03448 // with Inf(x) >= 0; 03449 // Blomquist, 03.05.2008; 03450 { 03451 int exl; 03452 lx_interval res(0.0); 03453 lx_real S1,S2; 03454 real ex; 03455 03456 ex = expo(x); 03457 l_interval xl(li_part(x)); 03458 exl = expo_gr(xl); 03459 03460 if (exl>-100000) { 03461 if (ex <= -exl-1600) 03462 { 03463 res = x; 03464 times2pown(res,1); // res = 2x; 03465 res = sqrt(res); // res = sqrt(2x); 03466 S2 = Sup(res); 03467 res = res * (1-x); 03468 S1 = Inf(res); 03469 res = lx_interval(S1,S2); 03470 } 03471 else 03472 if (ex <= -exl) 03473 res = lnp1( x + sqrt(x*(2+x)) ); 03474 else // res = acosh(1+x); 03475 { 03476 res = 1+x; 03477 res = ln(res + sqrtx2m1(res)); 03478 } 03479 } 03480 return res; 03481 } // Acoshp1_(...) 03482 03483 lx_interval acoshp1(const lx_interval &x) throw() 03484 // Inclusion of acosh(1+x); 03485 // Blomquist, 03.05.2008; 03486 { 03487 int stagsave = stagprec, 03488 stagmax = 39; 03489 if (stagprec>stagmax) 03490 stagprec = stagmax; 03491 l_interval lix(li_part(x)); 03492 if (Inf(lix)<0) 03493 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03494 ("lx_interval acoshp1(const lx_interval& x)")); 03495 lx_interval res,a; 03496 real r; 03497 03498 r = expo_RelDiam(lix); 03499 if (r > -107) // If the rel. diam of x is too great 03500 { // the acoshp1 function is calculated at the 03501 // boundary points of the interval x. Thus, the 03502 // inclusion res is the convex hull of these intervals: 03503 res = lx_interval(Inf(x)); 03504 res = Acoshp1_(res); 03505 a = lx_interval(Sup(x)); 03506 a = Acoshp1_(a); 03507 res = lx_interval(Inf(res),Sup(a)); 03508 } 03509 else 03510 res = Acoshp1_(x); 03511 03512 stagprec = stagsave; 03513 res = adjust(res); 03514 03515 return res; 03516 } // acoshp1() 03517 03518 // ------------------------ atanh(...) ---------------------------------- 03519 03520 lx_interval Atanh_(const lx_interval &x) throw() 03521 // Inclusion of atanh(x) only for sufficiently small 03522 // intervals x. Only for the internal use! 03523 // Blomquist, 03.05.2008; 03524 { 03525 int exl; 03526 lx_interval res(0.0); 03527 real ex(expo(x)); 03528 l_interval xl(li_part(x)); 03529 03530 exl = expo_gr(xl); 03531 03532 if (0<=xl) // Zero included by x 03533 { 03534 res = x/(1-x); 03535 times2pown(res,1); 03536 res = lnp1(res); 03537 } 03538 else // Zero not included by x! 03539 if (ex <= -2 - exl) 03540 { 03541 res = x/(1-x); 03542 times2pown(res,1); 03543 res = lnp1(res); 03544 } 03545 else 03546 res = ln( (1.0+x)/(1.0-x) ); 03547 times2pown(res,-1); 03548 03549 res = adjust(res); 03550 03551 return res; 03552 } // Atanh_(...) 03553 03554 lx_interval atanh(const lx_interval &x) throw() 03555 { 03556 int stagsave = stagprec, 03557 stagmax = 39; 03558 if (stagprec>stagmax) 03559 stagprec = stagmax; 03560 03561 lx_interval res,a; 03562 real r; 03563 03564 if (Inf(x)<=-1 || Sup(x)>=1) 03565 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03566 ("lx_interval atanh(const lx_interval& x)")); 03567 03568 r = expo_RelDiam(li_part(x)); 03569 if (r > -107) // If the rel. diam of x is too great 03570 { // the asinh function is calculated at the 03571 // boundary points of the interval x. Thus, the 03572 // inclusion res is the convex hull of these intervals: 03573 res = lx_interval(Inf(x)); 03574 res = Atanh_(res); 03575 a = lx_interval(Sup(x)); 03576 a = Atanh_(a); 03577 res = lx_interval(Inf(res),Sup(a)); 03578 } 03579 else 03580 res = Atanh_(x); 03581 03582 stagprec = stagsave; 03583 res = adjust(res); 03584 03585 return res; 03586 } // atanh() 03587 03588 // ------------------------ atanh1m(...) --------------------------------- 03589 03590 lx_interval Atanh1m_(const lx_interval &x) throw() 03591 // Inclusion of atanh(1-x); 0<x<2; 03592 // Only for not too wide intervals x; 03593 // For the internal use only! 03594 // Blomquist, 07.05.2008; 03595 { 03596 lx_interval res(0.0); 03597 res = ln(2/x-1); 03598 times2pown(res,-1); 03599 03600 return res; 03601 } // Atanh1m_(...) 03602 03603 lx_interval atanh1m(const lx_interval &x) throw() 03604 // Blomquist, 07.05.2008; 03605 { 03606 int stagsave = stagprec, 03607 stagmax = 39; 03608 if (stagprec > stagmax) 03609 stagprec = stagmax; 03610 03611 if (Inf(x)<=0 || Sup(x)>=2) 03612 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03613 ("lx_interval atanh1m(const lx_interval& x)")); 03614 03615 lx_interval res,a; 03616 real r; 03617 03618 r = expo_RelDiam(li_part(x)); 03619 if (r > -107) // If the rel. diam of x is too great 03620 { // the acot function is calculated at the 03621 // boundary points of the interval x. Thus, the 03622 // inclusion res is the convex hull of these intervals: 03623 res = lx_interval(Inf(x)); 03624 res = Atanh1m_(res); 03625 a = lx_interval(Sup(x)); 03626 a = Atanh1m_(a); 03627 res = lx_interval(Inf(a),Sup(res)); 03628 } 03629 else 03630 res = Atanh1m_(x); 03631 03632 stagprec = stagsave; 03633 res = adjust(res); 03634 03635 return res; 03636 } // atanh1m() 03637 03638 // ------------------------ atanhm1p(...) ------------------------------ 03639 03640 lx_interval atanhm1p(const lx_interval &x) throw() 03641 // Inclusion of atanh(-1+x) , 0<x<2; 03642 { 03643 int stagsave = stagprec, 03644 stagmax = 39; 03645 if (stagprec > stagmax) 03646 stagprec = stagmax; 03647 lx_interval res; 03648 03649 res = -atanh1m(x); 03650 03651 stagprec = stagsave; // Restore the old stagprec value 03652 res = adjust(res); 03653 03654 return res; 03655 } // atanhm1p 03656 03657 // ------------------------ acoth(...) --------------------------------- 03658 03659 lx_interval Acoth_(const lx_interval& x) throw() 03660 // acoth(x), x=[x1,x2], x1>1; Calculating 03661 // inclusions only for not too wide intervals; 03662 // Only for the internal use in acoth(x) ! 03663 // Blomquist, 13.05.2008; 03664 { 03665 lx_interval res; 03666 03667 res = lnp1(2/(x-1)); 03668 times2pown(res,-1); 03669 03670 return res; 03671 } // Acoth_ 03672 03673 lx_interval acoth(const lx_interval &x) throw() 03674 // Blomquist, 13.05.2008; 03675 { 03676 int stagsave = stagprec, 03677 stagmax = 39; 03678 if (stagprec > stagmax) stagprec = stagmax; 03679 03680 lx_interval res,a,u; 03681 l_interval xl(li_part(x)); 03682 bool neg; 03683 real r; 03684 03685 res = lx_interval(0,l_interval(-1,1)); 03686 if ( (Inf(x) <= res) || ((Sup(x)) <= res) || res <= x) 03687 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03688 ("lx_interval acoth(const lx_interval& x)")); 03689 neg = Inf(xl)<0; 03690 if (neg) u = -x; 03691 else u = x; // u = [u1,u2], u1 > 1; 03692 03693 r = expo_RelDiam(xl); 03694 if (r > -107) // If the rel. diam of x is too great 03695 { // the acoth function is calculated at the 03696 // boundary points of the interval x. Thus, the 03697 // inclusion res is the convex hull of these intervals: 03698 res = lx_interval(Inf(u)); 03699 res = Acoth_(res); 03700 a = lx_interval(Sup(u)); 03701 a = Acoth_(a); 03702 res = lx_interval(Inf(a),Sup(res)); 03703 } 03704 else 03705 res = Acoth_(u); 03706 if (neg) res = -res; 03707 03708 stagprec = stagsave; 03709 res = adjust(res); 03710 03711 return res; 03712 } // acoth() 03713 03714 // ------------------------ acoth(1+x) --------------------------------- 03715 03716 lx_interval Acothp1_(const lx_interval& x) throw() 03717 // arcoth(1+x), x>0; 03718 // only for not too wide intervals x and 03719 // only for the internal use in acothp1(...) 03720 // Blomquist, 14.05.2008; 03721 { 03722 lx_interval res; 03723 03724 res = lnp1(2/x); 03725 times2pown(res,-1); 03726 03727 return res; 03728 } // Acothp1_ 03729 03730 lx_interval acothp1(const lx_interval &x) throw() 03731 // Blomquist, 14.05.2008; 03732 { 03733 int stagsave = stagprec, 03734 stagmax = 39; 03735 03736 if (stagprec > stagmax) 03737 stagprec = stagmax; 03738 03739 lx_interval res,a; 03740 l_interval xl(li_part(x)); 03741 real r; 03742 03743 if (Inf(xl) <= 0.0) 03744 cxscthrow(ERROR_LINTERVAL_STD_FKT_OUT_OF_DEF 03745 ("lx_interval acothp1(const lx_interval& x)")); 03746 03747 r = expo_RelDiam(xl); 03748 if (r > -107) // If the rel. diam of x is too great 03749 { // the acot function is calculated at the 03750 // boundary points of the interval x. Thus, the 03751 // inclusion res is the convex hull of these intervals: 03752 res = lx_interval(Inf(x)); 03753 res = Acothp1_(res); 03754 a = lx_interval(Sup(x)); 03755 a = Acothp1_(a); 03756 res = lx_interval(Inf(a),Sup(res)); 03757 } 03758 else 03759 res = Acothp1_(x); 03760 03761 stagprec = stagsave; 03762 res = adjust(res); 03763 03764 return res; 03765 } // acothp1() 03766 03767 // ------------------------ acothm1m(...) ------------------------------ 03768 03769 lx_interval acothm1m(const lx_interval &x) throw() 03770 // Inclusion of acoth(-1-x) , x>0; 03771 { 03772 int stagsave = stagprec, 03773 stagmax = 39; 03774 if (stagprec > stagmax) 03775 stagprec = stagmax; 03776 lx_interval res; 03777 03778 res = -acothp1(x); 03779 03780 stagprec = stagsave; // Restore the old stagprec value 03781 res = adjust(res); 03782 03783 return res; 03784 } // acothm1m 03785 03786 // ------------------------ sqrt(x^2+y^2) ------------------------------ 03787 03788 lx_interval Sqrtx2y2_(const lx_interval &x, const lx_interval &y) throw() 03789 // Inclusion of sqrt(x^2+y^2); 03790 // x = [x1,x2], x1>=0; y = [y1,y2], y1>=0; x2>=y2; 03791 // For not too wide intervals x,y; 03792 // Blomquist, 15.05.2008; 03793 { 03794 const int c1=4000, 03795 c2=-100000; 03796 int exxl,exyl; 03797 real exx,exy; 03798 lx_interval res,ax,ay; 03799 lx_real R; 03800 R = Sup(y); 03801 exy = expo(R); 03802 exyl = expo_gr( lr_part(R) ); 03803 03804 R = Inf(x); 03805 exx = expo(R); 03806 exxl = expo_gr( lr_part(R) ); 03807 03808 if (exyl > c2) // y2 > 0; 03809 { 03810 exxl = exxl-exyl-1051; // Without integer-Overflow 03811 if (exy < exx + (exxl-1)) // (exxl-1) for security 03812 res = x * lx_interval(lx_real(1.0),Sup(One_p_lx_interval())); 03813 else 03814 { 03815 res = x; 03816 ax = x; ay = y; 03817 if (exx<-9007199254735000.0) 03818 { 03819 times2pown(ax,c1); 03820 times2pown(ay,c1); 03821 }; 03822 res = res * sqrt1px2(ay/ax); 03823 } 03824 } 03825 else // y2 = 0; 03826 res = x; 03827 03828 return res; 03829 } // Sqrtx2y2_(...) 03830 03831 lx_interval sqrtx2y2(const lx_interval &x, const lx_interval &y) throw() 03832 { 03833 int stagsave = stagprec, 03834 stagmax = 30, 03835 exyl,exxl; 03836 if (stagprec>stagmax) 03837 stagprec = stagmax; 03838 03839 const int c1=4000, 03840 c2=-100000; 03841 lx_interval res,ax,ay,u,v; 03842 lx_real R; 03843 real rx,ry; 03844 03845 ax = abs(x); ay = abs(y); 03846 if ( Sup(ay) > Sup(ax) ) 03847 { 03848 res = ax; ax = ay; ay = res; 03849 } // Sup(ax) >= Sup(ay); 03850 03851 if (0<=ax) // 0 is included by ax 03852 // The inclusion res is calculated as the convex hull 03853 // of the inclusions at the boundary bounds of ax,ay. 03854 { 03855 // Inclusion of the upper bound: 03856 R = Sup(ay); 03857 v = lx_interval(R); 03858 ry = expo(R); 03859 exyl = expo_gr( lr_part(R) ); 03860 03861 R = Sup(ax); 03862 u = lx_interval(R); 03863 rx = expo(R); 03864 exxl = expo_gr( lr_part(R) ); 03865 03866 if (exyl>c2) 03867 { 03868 exxl = exxl-exyl-1051; // Without integer overflow 03869 if (ry < rx + (exxl-1)) // (exxl-1) for security 03870 res = u * lx_interval(lx_real(1.0),Sup(One_p_lx_interval())); 03871 else 03872 { 03873 res = u; 03874 if (rx < -9007199254735000.0) 03875 { 03876 times2pown(u,c1); 03877 times2pown(v,c1); 03878 } 03879 res = res * sqrt1px2(v/u); 03880 } 03881 } 03882 else // v=0; 03883 res = u; 03884 // res is the inclusion of the function value 03885 // at the upper bounds of ax,ay; 03886 // Remember: Inf(ax)=0, so Inf(ay) is the lower bound 03887 // of the function value at the lower bounds of ax,ay; 03888 // Thus, the inclusion of sqrt(ax^2 + ay^2) is given by: 03889 res = lx_interval(Inf(ay),Sup(res)); 03890 } 03891 else // Inf(ax)>0: 03892 { 03893 rx = expo_RelDiam(li_part(ax)); 03894 ry = expo_RelDiam(li_part(ay)); 03895 if (rx > -107 || ry > -107) // If the rel. diam of ax or ay 03896 { // is too great the sqrtx2y2 function is calculated at 03897 // the boundary points of the intervals ax, ay. Thus, the 03898 // inclusion res is the convex hull of these intervals: 03899 u = lx_interval(Inf(ax)); 03900 v = lx_interval(Inf(ay)); 03901 res = Sqrtx2y2_(u,v); 03902 u = lx_interval(Sup(ax)); 03903 v = lx_interval(Sup(ay)); 03904 u = Sqrtx2y2_(u,v); 03905 res = lx_interval(Inf(res),Sup(u)); 03906 } 03907 else 03908 res = Sqrtx2y2_(ax,ay); 03909 } 03910 03911 stagprec = stagsave; 03912 res = adjust(res); 03913 return res; 03914 } // sqrtx2y2 03915 03916 // ---------------------- ln(sqrt(x^2+y^2)) ---------------------------- 03917 03918 lx_interval Ln_sqrtx2y2_(const lx_interval &x, const lx_interval &y) throw() 03919 // Inclusion of ln(sqrt(x^2+y^2)); 03920 // Blomquist, 19.05.2008; 03921 { 03922 lx_interval res,ax,ay; 03923 lx_real Rx,Ry; 03924 03925 ax = abs(x); ay = abs(y); 03926 Rx = Sup(ax); Ry = Sup(ay); 03927 if (Ry>Rx) 03928 { 03929 Rx = Ry; // Rx ist maximaler Wert 03930 res = ay; ay = ax; ax = res; // ax ist maximaler Wert 03931 } 03932 03933 if (Rx>100) res = ln( sqrtx2y2(ax,ay) ); 03934 else 03935 if (Rx<0.25) 03936 res = ln( sqrtx2y2(ax,ay) ); 03937 else 03938 { 03939 // Calculating: 0.5*ln(x*x + y*y) 03940 // = 0.5*ln(1 + (x*x + y*y - 1)) 03941 // = 0.5*ln(1 + ((x-1)*(x+1) + y*y)) 03942 if (ay==0.0) 03943 res = ln(ax); // Without Overflow! 03944 else 03945 { 03946 res = lnp1((ax-1)*(ax+1) + ay*ay); 03947 times2pown(res,-1); 03948 } 03949 } 03950 03951 return res; 03952 } // Ln_sqrtx2y2_(...) 03953 03954 lx_interval ln_sqrtx2y2(const lx_interval &x, const lx_interval &y) throw() 03955 { 03956 int stagsave = stagprec, 03957 stagmax = 30; 03958 if (stagprec>stagmax) stagprec = stagmax; 03959 03960 lx_interval res,ax,ay,u,v; 03961 real rx,ry; 03962 03963 ax = abs(x); ay = abs(y); 03964 if ( Sup(ay) > Sup(ax) ) 03965 { 03966 res = ax; ax = ay; ay = res; 03967 } // Sup(ax) >= Sup(ay); 03968 03969 rx = expo_RelDiam(li_part(ax)); 03970 ry = expo_RelDiam(li_part(ay)); 03971 if (rx > -107 || ry > -107) // If the rel. diam of ax or ay 03972 { // is too great the ln_sqrtx2y2 function is calculated at 03973 // the boundary points of the intervals ax, ay. Thus, the 03974 // inclusion res is the convex hull of these intervals: 03975 u = lx_interval(Inf(ax)); 03976 v = lx_interval(Inf(ay)); 03977 res = Ln_sqrtx2y2_(u,v); 03978 03979 u = lx_interval(Sup(ax)); 03980 v = lx_interval(Sup(ay)); 03981 u = Ln_sqrtx2y2_(u,v); 03982 03983 res = lx_interval(Inf(res),Sup(u)); 03984 } 03985 else 03986 res = Ln_sqrtx2y2_(ax,ay); 03987 03988 stagprec = stagsave; 03989 res = adjust(res); 03990 03991 return res; 03992 } // ln_sqrtx2y2 03993 03994 // -------------------------- n-th root -------------------------------- 03995 03996 lx_interval Sqrt_(const lx_interval& x, int n) throw() 03997 { // Inclusion of the n-th root, based on the pow(...) function 03998 // n>=2; For not too wide intervals x; 03999 // and for the internal use in sqrt(x,n) only! 04000 // Blomquist, 20.05.2008; 04001 lx_interval res; 04002 lx_real Sx; 04003 04004 if (eq_zero(Inf(x))) 04005 { 04006 Sx = Sup(x); 04007 if (gr_zero(Sx)) 04008 { 04009 res = pow(lx_interval(Sx),1/lx_interval(n)); 04010 res = lx_interval(lx_real(0),Sup(res)); 04011 } 04012 else res = 0.0; 04013 } 04014 else 04015 res = pow(x,1/lx_interval(n)); 04016 04017 return res; 04018 } // Sqrt_(...) 04019 04020 lx_interval sqrt(const lx_interval &x, int n) throw() 04021 { 04022 int stagsave = stagprec, 04023 stagmax = 39, 04024 k(n); 04025 if (stagprec>stagmax) stagprec = stagmax; 04026 04027 lx_interval res,a; 04028 real r; 04029 04030 if (k<2) k=2; 04031 04032 r = expo_RelDiam(li_part(x)); 04033 if (r > -107) // If the rel. diam of x is too great 04034 { // the sqrt(x,n) function is calculated at the 04035 // boundary points of the interval x. Thus, the 04036 // inclusion res is the convex hull of these intervals: 04037 res = lx_interval(Inf(x)); 04038 res = Sqrt_(res,k); 04039 a = lx_interval(Sup(x)); 04040 a = Sqrt_(a,k); 04041 res = lx_interval(Inf(res),Sup(a)); 04042 } 04043 else 04044 res = Sqrt_(x,k); 04045 04046 stagprec = stagsave; 04047 res = adjust(res); 04048 04049 return res; 04050 } // sqrt() 04051 04052 04053 // ---------------- Interval constants in high accuracy -------------------- 04054 04055 static real CXSC_Pi[40]; // CXSC_Pi[0], ... ,CXSC_Pi[39] 04056 static bool CXSC_Pi_initialized = false; 04057 04058 lx_interval Pi_lx_interval() throw() 04059 // Inclusion of Pi, Blomquist, 15.06.2007; 04060 { 04061 l_interval y; 04062 int stagsave = stagprec, 04063 stagmax = 39; // alt 04064 if (!CXSC_Pi_initialized) 04065 { 04066 std::string str; 04067 std::cout << SaveOpt; 04068 std::cout << Hex; 04069 str = "+1921FB54442D18e7FC"; 04070 str >> CXSC_Pi[0]; 04071 str = "+11A62633145C07e7C6"; 04072 str >> CXSC_Pi[1]; 04073 str = "-1F1976B7ED8FBCe78E"; 04074 str >> CXSC_Pi[2]; 04075 str = "+14CF98E804177De758"; 04076 str >> CXSC_Pi[3]; 04077 str = "+131D89CD9128A5e722"; 04078 str >> CXSC_Pi[4]; 04079 str = "+10F31C6809BBDFe6E8"; 04080 str >> CXSC_Pi[5]; 04081 str = "+1519B3CD3A431Be6B1"; 04082 str >> CXSC_Pi[6]; 04083 str = "+18158536F92F8Ae67A"; 04084 str >> CXSC_Pi[7]; 04085 str = "+1BA7F09AB6B6A9e642"; 04086 str >> CXSC_Pi[8]; 04087 str = "-1EDD0DBD2544CFe60A"; 04088 str >> CXSC_Pi[9]; 04089 str = "+179FB1BD1310BAe5D3"; 04090 str >> CXSC_Pi[10]; 04091 str = "+1A637ED6B0BFF6e59D"; 04092 str >> CXSC_Pi[11]; 04093 str = "-1A485FCA40908Ee566"; 04094 str >> CXSC_Pi[12]; 04095 str = "-1E501295D98169e52F"; 04096 str >> CXSC_Pi[13]; 04097 str = "-1160DBEE83B4E0e4F9"; 04098 str >> CXSC_Pi[14]; 04099 str = "-19B6D799AE131Ce4C1"; 04100 str >> CXSC_Pi[15]; 04101 str = "+16CF70801F2E28e48B"; 04102 str >> CXSC_Pi[16]; 04103 str = "+163BF0598DA483e455"; 04104 str >> CXSC_Pi[17]; 04105 str = "+1871574E69A459e41F"; 04106 str >> CXSC_Pi[18]; 04107 str = "-15C0B6CC281F27e3E3"; 04108 str >> CXSC_Pi[19]; 04109 str = "+15D23DCA3AD962e3AD"; 04110 str >> CXSC_Pi[20]; 04111 str = "-1CE8654EFBD56Ae376"; 04112 str >> CXSC_Pi[21]; 04113 str = "-1184AB5BE23DA6e33F"; 04114 str >> CXSC_Pi[22]; 04115 str = "+166D670C354E4Be309"; 04116 str >> CXSC_Pi[23]; 04117 str = "-10D9FEC3A2E4FEe2D3"; 04118 str >> CXSC_Pi[24]; 04119 str = "+1943042F86520Ce29C"; 04120 str >> CXSC_Pi[25]; 04121 str = "-1B9D1C931C41C6e265"; 04122 str >> CXSC_Pi[26]; 04123 str = "-188D3E7F179FC6e22D"; 04124 str >> CXSC_Pi[27]; 04125 str = "-1361F1744FE176e1F7"; 04126 str >> CXSC_Pi[28]; 04127 str = "+1F6B8ABBE0DE99e1C0"; 04128 str >> CXSC_Pi[29]; 04129 str = "-169B10EA1A04B5e18A"; 04130 str >> CXSC_Pi[30]; 04131 str = "-14FD1CF8CD56D0e154"; 04132 str >> CXSC_Pi[31]; 04133 str = "-18AB54A8D7516Fe11E"; 04134 str >> CXSC_Pi[32]; 04135 str = "+186263E8144056e0E7"; 04136 str >> CXSC_Pi[33]; 04137 str = "-1AE34AEAAA77A5e0B0"; 04138 str >> CXSC_Pi[34]; 04139 str = "+16998B8682283De07A"; 04140 str >> CXSC_Pi[35]; 04141 str = "+19D42A90D5EF8Ee042"; 04142 str >> CXSC_Pi[36]; 04143 str = "+174C9D9F70A08Be00C"; 04144 str >> CXSC_Pi[37]; 04145 str = "+100000000000DBe000"; 04146 str >> CXSC_Pi[38]; 04147 str = "+100000000000DCe000"; 04148 str >> CXSC_Pi[39]; 04149 04150 CXSC_Pi_initialized = true; 04151 std::cout << RestoreOpt; 04152 } 04153 stagprec = stagmax; 04154 y = adjust(l_interval(0)); 04155 04156 for (int i=0; i<=stagmax; i++) 04157 y[i+1] = CXSC_Pi[i]; 04158 04159 stagprec = stagsave; 04160 y = adjust(y); 04161 04162 return lx_interval(-1020,y); 04163 } // Pi 04164 04165 04166 static real CXSC_Ln2[40]; // CXSC_Ln2[0], ... ,CXSC_Ln2[39] 04167 static bool CXSC_Ln2_initialized = false; 04168 04169 lx_interval Ln2_lx_interval() throw() 04170 // Inclusion of ln(2), Blomquist, 15.06.2007; 04171 { 04172 l_interval y; 04173 int stagsave = stagprec, 04174 stagmax = 39; 04175 if (!CXSC_Ln2_initialized) 04176 { 04177 std::string str; 04178 std::cout << SaveOpt; 04179 std::cout << Hex; 04180 str = "+162E42FEFA39EFe7FC"; 04181 str >> CXSC_Ln2[0]; 04182 str = "+1ABC9E3B39803Fe7C5"; 04183 str >> CXSC_Ln2[1]; 04184 str = "+17B57A079A1934e78E"; 04185 str >> CXSC_Ln2[2]; 04186 str = "-1ACE93A4EBE5D1e758"; 04187 str >> CXSC_Ln2[3]; 04188 str = "-123A2A82EA0C24e722"; 04189 str >> CXSC_Ln2[4]; 04190 str = "+1D881B7AEB2615e6EB"; 04191 str >> CXSC_Ln2[5]; 04192 str = "+19552FB4AFA1B1e6B5"; 04193 str >> CXSC_Ln2[6]; 04194 str = "+1DA5D5C6B82704e67C"; 04195 str >> CXSC_Ln2[7]; 04196 str = "+14427573B29117e645"; 04197 str >> CXSC_Ln2[8]; 04198 str = "-191F6B05A4D7A7e60F"; 04199 str >> CXSC_Ln2[9]; 04200 str = "-1DB5173AE53426e5D9"; 04201 str >> CXSC_Ln2[10]; 04202 str = "+11317C387EB9EBe5A1"; 04203 str >> CXSC_Ln2[11]; 04204 str = "-190F13B267F137e56B"; 04205 str >> CXSC_Ln2[12]; 04206 str = "+16FA0EC7657F75e535"; 04207 str >> CXSC_Ln2[13]; 04208 str = "-1234C5E1398A6Be4FF"; 04209 str >> CXSC_Ln2[14]; 04210 str = "+1195EBBF4D7A70e4C8"; 04211 str >> CXSC_Ln2[15]; 04212 str = "+18192432AFD0C4e492"; 04213 str >> CXSC_Ln2[16]; 04214 str = "-1A1BE38BA4BA4De45C"; 04215 str >> CXSC_Ln2[17]; 04216 str = "-1D7860151CFC06e422"; 04217 str >> CXSC_Ln2[18]; 04218 str = "+19423F6B7F720Ce3EC"; 04219 str >> CXSC_Ln2[19]; 04220 str = "+10D30F88FE551Ae3B5"; 04221 str >> CXSC_Ln2[20]; 04222 str = "+1772B4EB6FE0F8e37E"; 04223 str >> CXSC_Ln2[21]; 04224 str = "-17AA0B477087B0e347"; 04225 str >> CXSC_Ln2[22]; 04226 str = "+1672C2E8C0EEBBe30C"; 04227 str >> CXSC_Ln2[23]; 04228 str = "+1C4C872E4A1F3Ae2D6"; 04229 str >> CXSC_Ln2[24]; 04230 str = "-1A970C65986667e2A0"; 04231 str >> CXSC_Ln2[25]; 04232 str = "-18CD36365759DAe26A"; 04233 str >> CXSC_Ln2[26]; 04234 str = "+1A1E0BD1D6095De231"; 04235 str >> CXSC_Ln2[27]; 04236 str = "+12B34D999AB252e1FA"; 04237 str >> CXSC_Ln2[28]; 04238 str = "-1912AC700EB43De1C4"; 04239 str >> CXSC_Ln2[29]; 04240 str = "-1B8BEFC5924FF5e18E"; 04241 str >> CXSC_Ln2[30]; 04242 str = "-180C2AE79DBFADe156"; 04243 str >> CXSC_Ln2[31]; 04244 str = "-17D195E5A6D545e120"; 04245 str >> CXSC_Ln2[32]; 04246 str = "-1743270F423129e0EA"; 04247 str >> CXSC_Ln2[33]; 04248 str = "+189E6DB6303659e0B2"; 04249 str >> CXSC_Ln2[34]; 04250 str = "-1F0E11945C9A4Ae07C"; 04251 str >> CXSC_Ln2[35]; 04252 str = "+18DAFA85A8C283e046"; 04253 str >> CXSC_Ln2[36]; 04254 str = "+13062D3458B6CFe00F"; 04255 str >> CXSC_Ln2[37]; 04256 str = "-10000000000C9Be000"; 04257 str >> CXSC_Ln2[38]; 04258 str = "-10000000000C9Ae000"; 04259 str >> CXSC_Ln2[39]; 04260 04261 CXSC_Ln2_initialized = true; 04262 std::cout << RestoreOpt; 04263 } 04264 stagprec = stagmax; 04265 y = adjust(l_interval(0)); 04266 04267 for (int i=0; i<=stagmax; i++) 04268 y[i+1] = CXSC_Ln2[i]; 04269 04270 stagprec = stagsave; 04271 y = adjust(y); 04272 04273 return lx_interval(-1022,y); 04274 } // ln(2) 04275 04276 static real CXSC_Ln10[40]; // CXSC_Ln10[0], ... ,CXSC_Ln10[39] 04277 static bool CXSC_Ln10_initialized = false; 04278 04279 lx_interval Ln10_lx_interval() throw() 04280 // Inclusion of ln(10), Blomquist, 15.06.2007; 04281 { 04282 l_interval y; 04283 int stagsave = stagprec, 04284 stagmax = 39; 04285 if (!CXSC_Ln10_initialized) 04286 { 04287 std::string str; 04288 std::cout << SaveOpt; 04289 std::cout << Hex; 04290 str = "+126BB1BBB55516e7FD"; 04291 str >> CXSC_Ln10[0]; 04292 str = "-1F48AD494EA3E9e7C7"; 04293 str >> CXSC_Ln10[1]; 04294 str = "-19EBAE3AE0260Ce791"; 04295 str >> CXSC_Ln10[2]; 04296 str = "-12D10378BE1CF1e75B"; 04297 str >> CXSC_Ln10[3]; 04298 str = "+10403E05AE52C6e725"; 04299 str >> CXSC_Ln10[4]; 04300 str = "-1FA509CAFDF466e6ED"; 04301 str >> CXSC_Ln10[5]; 04302 str = "-1C79A1FE9D0795e6B7"; 04303 str >> CXSC_Ln10[6]; 04304 str = "+1058C448308218e681"; 04305 str >> CXSC_Ln10[7]; 04306 str = "-1D250470877BFDe64A"; 04307 str >> CXSC_Ln10[8]; 04308 str = "-1AE92987D3075De612"; 04309 str >> CXSC_Ln10[9]; 04310 str = "-1D5CDBB8626956e5DC"; 04311 str >> CXSC_Ln10[10]; 04312 str = "-13C4F27CE0410Ae5A6"; 04313 str >> CXSC_Ln10[11]; 04314 str = "+1B3AC12ACF1BE9e570"; 04315 str >> CXSC_Ln10[12]; 04316 str = "+1161BB49D219C8e53A"; 04317 str >> CXSC_Ln10[13]; 04318 str = "-110D6613293728e504"; 04319 str >> CXSC_Ln10[14]; 04320 str = "+142163A4CDA351e4CC"; 04321 str >> CXSC_Ln10[15]; 04322 str = "+1E2713D6C22C16e494"; 04323 str >> CXSC_Ln10[16]; 04324 str = "-15090EF85CB0ADe45B"; 04325 str >> CXSC_Ln10[17]; 04326 str = "-1C5B3E859F876Ee424"; 04327 str >> CXSC_Ln10[18]; 04328 str = "-1C0D54B14459D9e3EC"; 04329 str >> CXSC_Ln10[19]; 04330 str = "+1AB685CD44E2C3e3B5"; 04331 str >> CXSC_Ln10[20]; 04332 str = "+1A47ECB26978C6e37E"; 04333 str >> CXSC_Ln10[21]; 04334 str = "-15812716B8AD41e347"; 04335 str >> CXSC_Ln10[22]; 04336 str = "-16047E37E81868e311"; 04337 str >> CXSC_Ln10[23]; 04338 str = "+1E14126A45765De2DA"; 04339 str >> CXSC_Ln10[24]; 04340 str = "-10ECBE631205C0e2A3"; 04341 str >> CXSC_Ln10[25]; 04342 str = "-15A485363BE7D4e26C"; 04343 str >> CXSC_Ln10[26]; 04344 str = "-1DEDE455922FF8e234"; 04345 str >> CXSC_Ln10[27]; 04346 str = "-1C202C3AE8B719e1FE"; 04347 str >> CXSC_Ln10[28]; 04348 str = "-148E3DB9B96D03e1C7"; 04349 str >> CXSC_Ln10[29]; 04350 str = "+1E3795D1008FE3e191"; 04351 str >> CXSC_Ln10[30]; 04352 str = "-13C992BD5AD855e158"; 04353 str >> CXSC_Ln10[31]; 04354 str = "-152096175A0882e122"; 04355 str >> CXSC_Ln10[32]; 04356 str = "+1BB0274A1CB072e0EB"; 04357 str >> CXSC_Ln10[33]; 04358 str = "-1D6A3FC0087494e0B4"; 04359 str >> CXSC_Ln10[34]; 04360 str = "+1AD6BFBFFD821Ce07E"; 04361 str >> CXSC_Ln10[35]; 04362 str = "-17D6CD3EE64A79e048"; 04363 str >> CXSC_Ln10[36]; 04364 str = "-166DC44198DC68e010"; 04365 str >> CXSC_Ln10[37]; 04366 str = "-100000000012D2e000"; 04367 str >> CXSC_Ln10[38]; 04368 str = "-100000000012D1e000"; 04369 str >> CXSC_Ln10[39]; 04370 04371 CXSC_Ln10_initialized = true; 04372 std::cout << RestoreOpt; 04373 } 04374 stagprec = stagmax; 04375 y = adjust(l_interval(0)); 04376 04377 for (int i=0; i<=stagmax; i++) 04378 y[i+1] = CXSC_Ln10[i]; 04379 04380 stagprec = stagsave; 04381 y = adjust(y); 04382 04383 return lx_interval(-1021,y); 04384 } // ln(10) 04385 04386 static real CXSC_Pir[40]; // CXSC_Pir[0], ... ,CXSC_Pir[39] 04387 static bool CXSC_Pir_initialized = false; 04388 04389 lx_interval Pir_lx_interval() throw() 04390 // Inclusion of 1/Pi, Blomquist, 15.06.2007; 04391 { 04392 l_interval y; 04393 int stagsave = stagprec, 04394 stagmax = 39; 04395 if (!CXSC_Pir_initialized) 04396 { 04397 std::string str; 04398 std::cout << SaveOpt; 04399 std::cout << Hex; 04400 str = "+145F306DC9C883e7FC"; 04401 str >> CXSC_Pir[0]; 04402 str = "-16B01EC5417056e7C6"; 04403 str >> CXSC_Pir[1]; 04404 str = "-16447E493AD4CEe790"; 04405 str >> CXSC_Pir[2]; 04406 str = "+1E21C820FF28B2e75A"; 04407 str >> CXSC_Pir[3]; 04408 str = "-1508510EA79237e723"; 04409 str >> CXSC_Pir[4]; 04410 str = "+1B8E909374B802e6EB"; 04411 str >> CXSC_Pir[5]; 04412 str = "-1B6D115F62E6DEe6B5"; 04413 str >> CXSC_Pir[6]; 04414 str = "-180F10A71A76B3e67E"; 04415 str >> CXSC_Pir[7]; 04416 str = "+1CFBA208D7D4BBe647"; 04417 str >> CXSC_Pir[8]; 04418 str = "-12EDEC598E3F65e60F"; 04419 str >> CXSC_Pir[9]; 04420 str = "-1741037D8CDC54e5D8"; 04421 str >> CXSC_Pir[10]; 04422 str = "+1CC1A99CFA4E42e5A2"; 04423 str >> CXSC_Pir[11]; 04424 str = "+17E2EF7E4A0EC8e56B"; 04425 str >> CXSC_Pir[12]; 04426 str = "-1DA00087E99FC0e52F"; 04427 str >> CXSC_Pir[13]; 04428 str = "-10D0EE74A5F593e4F9"; 04429 str >> CXSC_Pir[14]; 04430 str = "+1F6D367ECF27CBe4C1"; 04431 str >> CXSC_Pir[15]; 04432 str = "+136E9E8C7ECD3De488"; 04433 str >> CXSC_Pir[16]; 04434 str = "-100AE9456C229Ce452"; 04435 str >> CXSC_Pir[17]; 04436 str = "-141A0E84C2F8C6e419"; 04437 str >> CXSC_Pir[18]; 04438 str = "-10EB5ADA2B2809e3E0"; 04439 str >> CXSC_Pir[19]; 04440 str = "-10277039517BD5e3AA"; 04441 str >> CXSC_Pir[20]; 04442 str = "+198237E3DB5D60e36E"; 04443 str >> CXSC_Pir[21]; 04444 str = "-1E6087BECA1794e338"; 04445 str >> CXSC_Pir[22]; 04446 str = "+1DA9E391615EE6e301"; 04447 str >> CXSC_Pir[23]; 04448 str = "+1B086599855F15e2C9"; 04449 str >> CXSC_Pir[24]; 04450 str = "-17E5EFDC8009E0e293"; 04451 str >> CXSC_Pir[25]; 04452 str = "+135CC9CC418185e25B"; 04453 str >> CXSC_Pir[26]; 04454 str = "+156CA73A8C960Ee225"; 04455 str >> CXSC_Pir[27]; 04456 str = "+13DE04635A3E21e1EE"; 04457 str >> CXSC_Pir[28]; 04458 str = "-18F260C88C5FDBe1B7"; 04459 str >> CXSC_Pir[29]; 04460 str = "-157CA63B89746Ae181"; 04461 str >> CXSC_Pir[30]; 04462 str = "+1CA6DDAF44D157e149"; 04463 str >> CXSC_Pir[31]; 04464 str = "+19053EA5FF0705e111"; 04465 str >> CXSC_Pir[32]; 04466 str = "+1FBF19F419616Fe0DA"; 04467 str >> CXSC_Pir[33]; 04468 str = "+13E60C9F6EF0CFe0A3"; 04469 str >> CXSC_Pir[34]; 04470 str = "+126EF6B1E5EF8Ae06D"; 04471 str >> CXSC_Pir[35]; 04472 str = "-18BC1946A1B01Ce034"; 04473 str >> CXSC_Pir[36]; 04474 str = "-12780EDE6F8384e000"; 04475 str >> CXSC_Pir[37]; 04476 str = "+10000000000000e000"; 04477 str >> CXSC_Pir[38]; 04478 str = "+10000000000001e000"; 04479 str >> CXSC_Pir[39]; 04480 04481 CXSC_Pir_initialized = true; 04482 std::cout << RestoreOpt; 04483 } 04484 stagprec = stagmax; 04485 y = adjust(l_interval(0)); 04486 04487 for (int i=0; i<=stagmax; i++) 04488 y[i+1] = CXSC_Pir[i]; 04489 04490 stagprec = stagsave; 04491 y = adjust(y); 04492 04493 return lx_interval(-1023,y); 04494 } // 1/Pi 04495 04496 static real CXSC_SqrtPi[40]; // CXSC_SqrtPi[0], ... ,CXSC_SqrtPi[39] 04497 static bool CXSC_SqrtPi_initialized = false; 04498 04499 lx_interval SqrtPi_lx_interval() throw() 04500 // Inclusion of sqrt(Pi), Blomquist, 15.06.2007; 04501 { 04502 l_interval y; 04503 int stagsave = stagprec, 04504 stagmax = 39; 04505 if (!CXSC_SqrtPi_initialized) 04506 { 04507 std::string str; 04508 std::cout << SaveOpt; 04509 std::cout << Hex; 04510 str = "+1C5BF891B4EF6Be7FC"; 04511 str >> CXSC_SqrtPi[0]; 04512 str = "-1618F13EB7CA89e7C6"; 04513 str >> CXSC_SqrtPi[1]; 04514 str = "-1B1F0071B7AAE4e78E"; 04515 str >> CXSC_SqrtPi[2]; 04516 str = "-1389B5A46BDFE8e757"; 04517 str >> CXSC_SqrtPi[3]; 04518 str = "-160AF5C5C89448e721"; 04519 str >> CXSC_SqrtPi[4]; 04520 str = "-14835F07122994e6E5"; 04521 str >> CXSC_SqrtPi[5]; 04522 str = "+1CEC283C18EE8Fe6AF"; 04523 str >> CXSC_SqrtPi[6]; 04524 str = "-13ADEBB9223CA8e678"; 04525 str >> CXSC_SqrtPi[7]; 04526 str = "+1454912430D291e642"; 04527 str >> CXSC_SqrtPi[8]; 04528 str = "-1E8B2345020EF6e60C"; 04529 str >> CXSC_SqrtPi[9]; 04530 str = "-17262982556291e5D5"; 04531 str >> CXSC_SqrtPi[10]; 04532 str = "+1196FA9B140CABe59E"; 04533 str >> CXSC_SqrtPi[11]; 04534 str = "-175EEE59D91D39e568"; 04535 str >> CXSC_SqrtPi[12]; 04536 str = "+1789268B7D9D48e52D"; 04537 str >> CXSC_SqrtPi[13]; 04538 str = "+17162E2F06B89Ce4F7"; 04539 str >> CXSC_SqrtPi[14]; 04540 str = "+1EC9C08F40A3DBe4C0"; 04541 str >> CXSC_SqrtPi[15]; 04542 str = "+1B6048DD0729E2e48A"; 04543 str >> CXSC_SqrtPi[16]; 04544 str = "+1471CF4C33FF6Be453"; 04545 str >> CXSC_SqrtPi[17]; 04546 str = "+1D75FBD8B36F94e41D"; 04547 str >> CXSC_SqrtPi[18]; 04548 str = "+16BA59D137CC6Ee3E7"; 04549 str >> CXSC_SqrtPi[19]; 04550 str = "-1FDFA25FB4BFD8e3B1"; 04551 str >> CXSC_SqrtPi[20]; 04552 str = "-1699363F68227Be379"; 04553 str >> CXSC_SqrtPi[21]; 04554 str = "-1BDD2FD4684487e342"; 04555 str >> CXSC_SqrtPi[22]; 04556 str = "+1122B2D8015ED6e30B"; 04557 str >> CXSC_SqrtPi[23]; 04558 str = "-17EB1A81424DE5e2D2"; 04559 str >> CXSC_SqrtPi[24]; 04560 str = "+1C08B42B2EB0E0e29C"; 04561 str >> CXSC_SqrtPi[25]; 04562 str = "-1316DE24F93E9Fe266"; 04563 str >> CXSC_SqrtPi[26]; 04564 str = "+129354F2D42931e230"; 04565 str >> CXSC_SqrtPi[27]; 04566 str = "-1CB7B480D41490e1FA"; 04567 str >> CXSC_SqrtPi[28]; 04568 str = "+1608DE7786C4ABe1C3"; 04569 str >> CXSC_SqrtPi[29]; 04570 str = "-117732A85F48BCe18D"; 04571 str >> CXSC_SqrtPi[30]; 04572 str = "-18BFB034DC2D75e156"; 04573 str >> CXSC_SqrtPi[31]; 04574 str = "+155DAB8C4A398Ee120"; 04575 str >> CXSC_SqrtPi[32]; 04576 str = "+161C9A5BA77FF3e0E8"; 04577 str >> CXSC_SqrtPi[33]; 04578 str = "-1ECF0081DB503Ce0B2"; 04579 str >> CXSC_SqrtPi[34]; 04580 str = "-192FF4749E0FD8e07B"; 04581 str >> CXSC_SqrtPi[35]; 04582 str = "-1B84C9BCD51654e044"; 04583 str >> CXSC_SqrtPi[36]; 04584 str = "-11CF482677D72Fe00A"; 04585 str >> CXSC_SqrtPi[37]; 04586 str = "-10000000000025e000"; 04587 str >> CXSC_SqrtPi[38]; 04588 str = "-10000000000024e000"; 04589 str >> CXSC_SqrtPi[39]; 04590 04591 CXSC_SqrtPi_initialized = true; 04592 std::cout << RestoreOpt; 04593 } 04594 stagprec = stagmax; 04595 y = adjust(l_interval(0)); 04596 04597 for (int i=0; i<=stagmax; i++) 04598 y[i+1] = CXSC_SqrtPi[i]; 04599 04600 stagprec = stagsave; 04601 y = adjust(y); 04602 04603 return lx_interval(-1021,y); 04604 } // sqrt(Pi) 04605 04606 static real CXSC_Sqrt2Pi[40]; // CXSC_Sqrt2Pi[0], ... ,CXSC_Sqrt2Pi[39] 04607 static bool CXSC_Sqrt2Pi_initialized = false; 04608 04609 lx_interval Sqrt2Pi_lx_interval() throw() 04610 // Inclusion of sqrt(2*Pi), Blomquist, 15.06.2007; 04611 { 04612 l_interval y; 04613 int stagsave = stagprec, 04614 stagmax = 39; 04615 if (!CXSC_Sqrt2Pi_initialized) 04616 { 04617 std::string str; 04618 std::cout << SaveOpt; 04619 std::cout << Hex; 04620 str = "+140D931FF62706e7FD"; 04621 str >> CXSC_Sqrt2Pi[0]; 04622 str = "-1A6A0D6F814637e7C7"; 04623 str >> CXSC_Sqrt2Pi[1]; 04624 str = "-1311D073060ACEe791"; 04625 str >> CXSC_Sqrt2Pi[2]; 04626 str = "+16000B50DC2F41e758"; 04627 str >> CXSC_Sqrt2Pi[3]; 04628 str = "+16EF75CA45A834e721"; 04629 str >> CXSC_Sqrt2Pi[4]; 04630 str = "+19BDB2B4C39342e6E9"; 04631 str >> CXSC_Sqrt2Pi[5]; 04632 str = "+1F5582E2063EE6e6B2"; 04633 str >> CXSC_Sqrt2Pi[6]; 04634 str = "+183F879BEA150Ce679"; 04635 str >> CXSC_Sqrt2Pi[7]; 04636 str = "-1F1EA3CA289B00e641"; 04637 str >> CXSC_Sqrt2Pi[8]; 04638 str = "-1699CDA77736F9e60A"; 04639 str >> CXSC_Sqrt2Pi[9]; 04640 str = "-11A379D298B55Ee5D1"; 04641 str >> CXSC_Sqrt2Pi[10]; 04642 str = "-1A6DDB0152BA94e59B"; 04643 str >> CXSC_Sqrt2Pi[11]; 04644 str = "-1957E2E58A02FEe564"; 04645 str >> CXSC_Sqrt2Pi[12]; 04646 str = "-1D6160F18E604De52E"; 04647 str >> CXSC_Sqrt2Pi[13]; 04648 str = "+1311860CDF7215e4F5"; 04649 str >> CXSC_Sqrt2Pi[14]; 04650 str = "+12271F44C50274e4BE"; 04651 str >> CXSC_Sqrt2Pi[15]; 04652 str = "-100BF5C5497A21e487"; 04653 str >> CXSC_Sqrt2Pi[16]; 04654 str = "+1E94B6E6AD51E2e44F"; 04655 str >> CXSC_Sqrt2Pi[17]; 04656 str = "-1C910B5F3D27CEe416"; 04657 str >> CXSC_Sqrt2Pi[18]; 04658 str = "+1F266C0EA9E7FBe3E0"; 04659 str >> CXSC_Sqrt2Pi[19]; 04660 str = "+1D84A8782A175De3AA"; 04661 str >> CXSC_Sqrt2Pi[20]; 04662 str = "-1C75F70BEA4BE2e36F"; 04663 str >> CXSC_Sqrt2Pi[21]; 04664 str = "+1ABE52E82F3797e338"; 04665 str >> CXSC_Sqrt2Pi[22]; 04666 str = "-10A542CE87822Be302"; 04667 str >> CXSC_Sqrt2Pi[23]; 04668 str = "+1457EC878576D9e2CC"; 04669 str >> CXSC_Sqrt2Pi[24]; 04670 str = "-1E99158B23E861e296"; 04671 str >> CXSC_Sqrt2Pi[25]; 04672 str = "-178F7C0F0F2130e25F"; 04673 str >> CXSC_Sqrt2Pi[26]; 04674 str = "-12619EF8E11367e223"; 04675 str >> CXSC_Sqrt2Pi[27]; 04676 str = "-1F5C2604AB7BA5e1EC"; 04677 str >> CXSC_Sqrt2Pi[28]; 04678 str = "+13ED3039D91C88e1B2"; 04679 str >> CXSC_Sqrt2Pi[29]; 04680 str = "-19055B38C434DDe17A"; 04681 str >> CXSC_Sqrt2Pi[30]; 04682 str = "+1A7547A2C9CA85e144"; 04683 str >> CXSC_Sqrt2Pi[31]; 04684 str = "-1543DE12F9EBD5e10E"; 04685 str >> CXSC_Sqrt2Pi[32]; 04686 str = "+180AD772E1F1A0e0D8"; 04687 str >> CXSC_Sqrt2Pi[33]; 04688 str = "+1FEF40C66F715Ee0A2"; 04689 str >> CXSC_Sqrt2Pi[34]; 04690 str = "+14C244F317CD0De069"; 04691 str >> CXSC_Sqrt2Pi[35]; 04692 str = "-1A29C32DBBFCAFe030"; 04693 str >> CXSC_Sqrt2Pi[36]; 04694 str = "-1038D4217EB5FCe000"; 04695 str >> CXSC_Sqrt2Pi[37]; 04696 str = "-10000000000001e000"; 04697 str >> CXSC_Sqrt2Pi[38]; 04698 str = "-10000000000000e000"; 04699 str >> CXSC_Sqrt2Pi[39]; 04700 04701 04702 CXSC_Sqrt2Pi_initialized = true; 04703 std::cout << RestoreOpt; 04704 } 04705 stagprec = stagmax; 04706 y = adjust(l_interval(0)); 04707 04708 for (int i=0; i<=stagmax; i++) 04709 y[i+1] = CXSC_Sqrt2Pi[i]; 04710 04711 stagprec = stagsave; 04712 y = adjust(y); 04713 04714 return lx_interval(-1021,y); 04715 } // sqrt(2*Pi) 04716 04717 static real CXSC_Sqrt2[40]; // CXSC_Sqrt2[0], ... ,CXSC_Sqrt2[39] 04718 static bool CXSC_Sqrt2_initialized = false; 04719 04720 lx_interval Sqrt2_lx_interval() throw() 04721 // Inclusion of sqrt(2), Blomquist, 15.06.2007; 04722 { 04723 l_interval y; 04724 int stagsave = stagprec, 04725 stagmax = 39; 04726 if (!CXSC_Sqrt2_initialized) 04727 { 04728 std::string str; 04729 std::cout << SaveOpt; 04730 std::cout << Hex; 04731 str = "+16A09E667F3BCDe7FC"; 04732 str >> CXSC_Sqrt2[0]; 04733 str = "-1BDD3413B26456e7C6"; 04734 str >> CXSC_Sqrt2[1]; 04735 str = "+157D3E3ADEC175e790"; 04736 str >> CXSC_Sqrt2[2]; 04737 str = "+12775099DA2F59e758"; 04738 str >> CXSC_Sqrt2[3]; 04739 str = "+160CCE64552BF2e71F"; 04740 str >> CXSC_Sqrt2[4]; 04741 str = "+1821D5C5161D46e6E6"; 04742 str >> CXSC_Sqrt2[5]; 04743 str = "-1C032046F8498Ee6B0"; 04744 str >> CXSC_Sqrt2[6]; 04745 str = "+1EE950BC8738F7e678"; 04746 str >> CXSC_Sqrt2[7]; 04747 str = "-1AC3FDBC64E103e642"; 04748 str >> CXSC_Sqrt2[8]; 04749 str = "+13B469101743A1e60A"; 04750 str >> CXSC_Sqrt2[9]; 04751 str = "+15E3E9CA60B38Ce5D4"; 04752 str >> CXSC_Sqrt2[10]; 04753 str = "+11BC337BCAB1BDe599"; 04754 str >> CXSC_Sqrt2[11]; 04755 str = "-1BBA5DEE9D6E7De563"; 04756 str >> CXSC_Sqrt2[12]; 04757 str = "-1438DD083B1CC4e52D"; 04758 str >> CXSC_Sqrt2[13]; 04759 str = "+1B56A28E2EDFA7e4F7"; 04760 str >> CXSC_Sqrt2[14]; 04761 str = "+1CCB2A634331F4e4C1"; 04762 str >> CXSC_Sqrt2[15]; 04763 str = "-1BD9056876F83Ee48A"; 04764 str >> CXSC_Sqrt2[16]; 04765 str = "-1234FA22AB6BEFe454"; 04766 str >> CXSC_Sqrt2[17]; 04767 str = "+19040CA4A81395e41D"; 04768 str >> CXSC_Sqrt2[18]; 04769 str = "-15249C0BC4082De3E7"; 04770 str >> CXSC_Sqrt2[19]; 04771 str = "+13A02CEBC93E0Ce3B1"; 04772 str >> CXSC_Sqrt2[20]; 04773 str = "+109936AF354A2Ee37B"; 04774 str >> CXSC_Sqrt2[21]; 04775 str = "-1AE4730CBE4908e345"; 04776 str >> CXSC_Sqrt2[22]; 04777 str = "+11B6380826E010e30E"; 04778 str >> CXSC_Sqrt2[23]; 04779 str = "-1CDCAD0CCD5A16e2D5"; 04780 str >> CXSC_Sqrt2[24]; 04781 str = "-1084BC28012BC8e29C"; 04782 str >> CXSC_Sqrt2[25]; 04783 str = "-1C035DDECF8216e265"; 04784 str >> CXSC_Sqrt2[26]; 04785 str = "+18907DEAA070B0e22B"; 04786 str >> CXSC_Sqrt2[27]; 04787 str = "+1FCBDDEA2F7DC3e1F5"; 04788 str >> CXSC_Sqrt2[28]; 04789 str = "+18C41C51757FB0e1BE"; 04790 str >> CXSC_Sqrt2[29]; 04791 str = "-189A5B616B1381e188"; 04792 str >> CXSC_Sqrt2[30]; 04793 str = "+165C417EFF0B88e152"; 04794 str >> CXSC_Sqrt2[31]; 04795 str = "-1627043F832999e11A"; 04796 str >> CXSC_Sqrt2[32]; 04797 str = "+105E5FCA017092e0E3"; 04798 str >> CXSC_Sqrt2[33]; 04799 str = "-187A16D6A8FDCAe0AD"; 04800 str >> CXSC_Sqrt2[34]; 04801 str = "-1838421AE0AE62e072"; 04802 str >> CXSC_Sqrt2[35]; 04803 str = "-165073EB433984e03C"; 04804 str >> CXSC_Sqrt2[36]; 04805 str = "+1F0A42F9DA4A6Ce006"; 04806 str >> CXSC_Sqrt2[37]; 04807 str = "+10000000000002e000"; 04808 str >> CXSC_Sqrt2[38]; 04809 str = "+10000000000003e000"; 04810 str >> CXSC_Sqrt2[39]; 04811 04812 CXSC_Sqrt2_initialized = true; 04813 std::cout << RestoreOpt; 04814 } 04815 stagprec = stagmax; 04816 y = adjust(l_interval(0)); 04817 04818 for (int i=0; i<=stagmax; i++) 04819 y[i+1] = CXSC_Sqrt2[i]; 04820 04821 stagprec = stagsave; 04822 y = adjust(y); 04823 04824 return lx_interval(-1021,y); 04825 } // sqrt(2) 04826 04827 static real CXSC_Sqrt3[40]; // CXSC_Sqrt3[0], ... ,CXSC_Sqrt3[39] 04828 static bool CXSC_Sqrt3_initialized = false; 04829 04830 lx_interval Sqrt3_lx_interval() throw() 04831 // Inclusion of sqrt(3), Blomquist, 15.06.2007; 04832 { 04833 l_interval y; 04834 int stagsave = stagprec, 04835 stagmax = 39; 04836 if (!CXSC_Sqrt3_initialized) 04837 { 04838 std::string str; 04839 std::cout << SaveOpt; 04840 std::cout << Hex; 04841 str = "+1BB67AE8584CAAe7FC"; 04842 str >> CXSC_Sqrt3[0]; 04843 str = "+1CEC95D0B5C1E3e7C6"; 04844 str >> CXSC_Sqrt3[1]; 04845 str = "-1F11DB689F2CCFe78E"; 04846 str >> CXSC_Sqrt3[2]; 04847 str = "+13DA4798C720A6e758"; 04848 str >> CXSC_Sqrt3[3]; 04849 str = "+121B9169B89243e722"; 04850 str >> CXSC_Sqrt3[4]; 04851 str = "-1813508751212Be6E9"; 04852 str >> CXSC_Sqrt3[5]; 04853 str = "-1B3D547B775C1Ee6B2"; 04854 str >> CXSC_Sqrt3[6]; 04855 str = "-19D986D92E2F0Ae679"; 04856 str >> CXSC_Sqrt3[7]; 04857 str = "+1A34334CE806B6e642"; 04858 str >> CXSC_Sqrt3[8]; 04859 str = "+1A383B9E122E61e60C"; 04860 str >> CXSC_Sqrt3[9]; 04861 str = "+1C61D736F2F6F2e5D5"; 04862 str >> CXSC_Sqrt3[10]; 04863 str = "-10AF49233F9250e59E"; 04864 str >> CXSC_Sqrt3[11]; 04865 str = "-1558A109EC0523e567"; 04866 str >> CXSC_Sqrt3[12]; 04867 str = "+1F799D4D4FF2BCe531"; 04868 str >> CXSC_Sqrt3[13]; 04869 str = "-1AD7B219E34EDBe4FB"; 04870 str >> CXSC_Sqrt3[14]; 04871 str = "+15AB940B6677E3e4C5"; 04872 str >> CXSC_Sqrt3[15]; 04873 str = "-1D9B2A8203B8F0e48E"; 04874 str >> CXSC_Sqrt3[16]; 04875 str = "-1DB0C8975A3834e458"; 04876 str >> CXSC_Sqrt3[17]; 04877 str = "-1BCAAB3F6BE884e422"; 04878 str >> CXSC_Sqrt3[18]; 04879 str = "+14C70ADB1EC1BBe3E8"; 04880 str >> CXSC_Sqrt3[19]; 04881 str = "-14E1EF77987E55e3AF"; 04882 str >> CXSC_Sqrt3[20]; 04883 str = "-19695FC6269D28e378"; 04884 str >> CXSC_Sqrt3[21]; 04885 str = "+10D0652AAC5936e342"; 04886 str >> CXSC_Sqrt3[22]; 04887 str = "-1BD0891D370824e30C"; 04888 str >> CXSC_Sqrt3[23]; 04889 str = "-129B4C6252D061e2D4"; 04890 str >> CXSC_Sqrt3[24]; 04891 str = "+1DC9B1A4C31275e29E"; 04892 str >> CXSC_Sqrt3[25]; 04893 str = "+11FF9B8422294Ee267"; 04894 str >> CXSC_Sqrt3[26]; 04895 str = "-1E4A6AA47F3A85e231"; 04896 str >> CXSC_Sqrt3[27]; 04897 str = "+17043E01AA3F3De1FA"; 04898 str >> CXSC_Sqrt3[28]; 04899 str = "+188EF377D2D5B6e1C0"; 04900 str >> CXSC_Sqrt3[29]; 04901 str = "-1735E8C815F031e185"; 04902 str >> CXSC_Sqrt3[30]; 04903 str = "-1B89330FD8417Ce14F"; 04904 str >> CXSC_Sqrt3[31]; 04905 str = "+16D1A627670F5Ce117"; 04906 str >> CXSC_Sqrt3[32]; 04907 str = "+1AF43BBA8154D3e0DB"; 04908 str >> CXSC_Sqrt3[33]; 04909 str = "+1DA9A969A91295e0A5"; 04910 str >> CXSC_Sqrt3[34]; 04911 str = "-1636594394C675e06E"; 04912 str >> CXSC_Sqrt3[35]; 04913 str = "+1064B9DA1A3185e037"; 04914 str >> CXSC_Sqrt3[36]; 04915 str = "-1CE514CF1825CCe001"; 04916 str >> CXSC_Sqrt3[37]; 04917 str = "+10000000000000e000"; 04918 str >> CXSC_Sqrt3[38]; 04919 str = "+10000000000001e000"; 04920 str >> CXSC_Sqrt3[39]; 04921 04922 CXSC_Sqrt3_initialized = true; 04923 std::cout << RestoreOpt; 04924 } 04925 stagprec = stagmax; 04926 y = adjust(l_interval(0)); 04927 04928 for (int i=0; i<=stagmax; i++) 04929 y[i+1] = CXSC_Sqrt3[i]; 04930 04931 stagprec = stagsave; 04932 y = adjust(y); 04933 04934 return lx_interval(-1021,y); 04935 } // sqrt(3) 04936 04937 static real CXSC_Ln2r[40]; // CXSC_Ln2r[0], ... ,CXSC_Ln2r[39] 04938 static bool CXSC_Ln2r_initialized = false; 04939 04940 lx_interval Ln2r_lx_interval() throw() 04941 // Inclusion of 1/ln(2), Blomquist, 15.06.2007; 04942 { 04943 l_interval y; 04944 int stagsave = stagprec, 04945 stagmax = 39; 04946 if (!CXSC_Ln2r_initialized) 04947 { 04948 std::string str; 04949 std::cout << SaveOpt; 04950 std::cout << Hex; 04951 str = "+171547652B82FEe7FC"; 04952 str >> CXSC_Ln2r[0]; 04953 str = "+1777D0FFDA0D24e7C4"; 04954 str >> CXSC_Ln2r[1]; 04955 str = "-160BB8A5442AB9e78E"; 04956 str >> CXSC_Ln2r[2]; 04957 str = "-14B52D3BA6D74De756"; 04958 str >> CXSC_Ln2r[3]; 04959 str = "+19A342648FBC39e720"; 04960 str >> CXSC_Ln2r[4]; 04961 str = "-1E0455744994EEe6EA"; 04962 str >> CXSC_Ln2r[5]; 04963 str = "+1B25EEB82D7C16e6B4"; 04964 str >> CXSC_Ln2r[6]; 04965 str = "+1F5485CF306255e67E"; 04966 str >> CXSC_Ln2r[7]; 04967 str = "-1EC07680A1F958e648"; 04968 str >> CXSC_Ln2r[8]; 04969 str = "-106326680EB5B6e612"; 04970 str >> CXSC_Ln2r[9]; 04971 str = "-1B3D04C549BC98e5DC"; 04972 str >> CXSC_Ln2r[10]; 04973 str = "+1EABCEAD10305Be5A6"; 04974 str >> CXSC_Ln2r[11]; 04975 str = "-14440C57D7AB97e56D"; 04976 str >> CXSC_Ln2r[12]; 04977 str = "-17185D42A4E6D6e536"; 04978 str >> CXSC_Ln2r[13]; 04979 str = "-1F332B5BE48526e4FE"; 04980 str >> CXSC_Ln2r[14]; 04981 str = "+12CE4F199E108De4C8"; 04982 str >> CXSC_Ln2r[15]; 04983 str = "-18DAFCC6077F2Ae48F"; 04984 str >> CXSC_Ln2r[16]; 04985 str = "+19ABB71EC25E12e458"; 04986 str >> CXSC_Ln2r[17]; 04987 str = "-11473D7A3366BDe41F"; 04988 str >> CXSC_Ln2r[18]; 04989 str = "-125DF4E28B5ED4e3E8"; 04990 str >> CXSC_Ln2r[19]; 04991 str = "+1C64262D010330e3B2"; 04992 str >> CXSC_Ln2r[20]; 04993 str = "-17DCAE42742BDEe37C"; 04994 str >> CXSC_Ln2r[21]; 04995 str = "+109C8C7E7B896Fe346"; 04996 str >> CXSC_Ln2r[22]; 04997 str = "+10C470FE2464B9e310"; 04998 str >> CXSC_Ln2r[23]; 04999 str = "-1B5F6CFB7C34BEe2DA"; 05000 str >> CXSC_Ln2r[24]; 05001 str = "-125E5DBA4A1165e2A1"; 05002 str >> CXSC_Ln2r[25]; 05003 str = "-1FA683975309E6e26A"; 05004 str >> CXSC_Ln2r[26]; 05005 str = "-140C23C4E5CC64e233"; 05006 str >> CXSC_Ln2r[27]; 05007 str = "+117670EC70E797e1FD"; 05008 str >> CXSC_Ln2r[28]; 05009 str = "+1B2A04B8E7416Ce1C7"; 05010 str >> CXSC_Ln2r[29]; 05011 str = "+11D96159397087e18F"; 05012 str >> CXSC_Ln2r[30]; 05013 str = "+10E29D810B4C60e159"; 05014 str >> CXSC_Ln2r[31]; 05015 str = "+1D7442ECEFEFA1e123"; 05016 str >> CXSC_Ln2r[32]; 05017 str = "+1CE25B70026529e0ED"; 05018 str >> CXSC_Ln2r[33]; 05019 str = "-12CA24549E0811e0B7"; 05020 str >> CXSC_Ln2r[34]; 05021 str = "+1220755E0827AEe080"; 05022 str >> CXSC_Ln2r[35]; 05023 str = "+1086BCE30D4370e04A"; 05024 str >> CXSC_Ln2r[36]; 05025 str = "-16FF855E4293BCe011"; 05026 str >> CXSC_Ln2r[37]; 05027 str = "+10000000002A50e000"; 05028 str >> CXSC_Ln2r[38]; 05029 str = "+10000000002A51e000"; 05030 str >> CXSC_Ln2r[39]; 05031 05032 CXSC_Ln2r_initialized = true; 05033 std::cout << RestoreOpt; 05034 } 05035 stagprec = stagmax; 05036 y = adjust(l_interval(0)); 05037 05038 for (int i=0; i<=stagmax; i++) 05039 y[i+1] = CXSC_Ln2r[i]; 05040 05041 stagprec = stagsave; 05042 y = adjust(y); 05043 05044 return lx_interval(-1021,y); 05045 } // 1/ln(2) 05046 05047 static real CXSC_Pid3[40]; // CXSC_Pid3[0], ... ,CXSC_Pid3[39] 05048 static bool CXSC_Pid3_initialized = false; 05049 05050 lx_interval Pid3_lx_interval() throw() 05051 // Inclusion of Pi/3, Blomquist, 15.06.2007; 05052 { 05053 l_interval y; 05054 int stagsave = stagprec, 05055 stagmax = 39; 05056 if (!CXSC_Pid3_initialized) 05057 { 05058 std::string str; 05059 std::cout << SaveOpt; 05060 std::cout << Hex; 05061 str = "+10C152382D7366e7FD"; 05062 str >> CXSC_Pid3[0]; 05063 str = "-1EE6913347C2A6e7C7"; 05064 str >> CXSC_Pid3[1]; 05065 str = "-14BBA47A9E5FD2e78F"; 05066 str >> CXSC_Pid3[2]; 05067 str = "-1CCAEF65529B02e759"; 05068 str >> CXSC_Pid3[3]; 05069 str = "+197CB7BCC18B87e722"; 05070 str >> CXSC_Pid3[4]; 05071 str = "-13EBBDA1FF3058e6EC"; 05072 str >> CXSC_Pid3[5]; 05073 str = "-11D10CB320F4D1e6B4"; 05074 str >> CXSC_Pid3[6]; 05075 str = "+1958EB892987ECe67D"; 05076 str >> CXSC_Pid3[7]; 05077 str = "+167C54B11CF247e647"; 05078 str >> CXSC_Pid3[8]; 05079 str = "+12C2E985923A44e60E"; 05080 str >> CXSC_Pid3[9]; 05081 str = "+1945484A2DD81Fe5D6"; 05082 str >> CXSC_Pid3[10]; 05083 str = "+1197A9E475D54Fe59E"; 05084 str >> CXSC_Pid3[11]; 05085 str = "-1E181FEE158585e568"; 05086 str >> CXSC_Pid3[12]; 05087 str = "+1047FCE7066A6Ee532"; 05088 str >> CXSC_Pid3[13]; 05089 str = "+1D1A8602EA0C85e4FC"; 05090 str >> CXSC_Pid3[14]; 05091 str = "+14430C5998BF34e4C6"; 05092 str >> CXSC_Pid3[15]; 05093 str = "+173BF40AAD43D9e48F"; 05094 str >> CXSC_Pid3[16]; 05095 str = "-137B014DDEDCF5e459"; 05096 str >> CXSC_Pid3[17]; 05097 str = "-1A5F1B210EE7C5e420"; 05098 str >> CXSC_Pid3[18]; 05099 str = "+151B536DDF9502e3EA"; 05100 str >> CXSC_Pid3[19]; 05101 str = "+10E4DB4F709CEEe3B4"; 05102 str >> CXSC_Pid3[20]; 05103 str = "+16841F78EC058Ee37E"; 05104 str >> CXSC_Pid3[21]; 05105 str = "+1D269E370AFA06e346"; 05106 str >> CXSC_Pid3[22]; 05107 str = "+119123BD75E37Be310"; 05108 str >> CXSC_Pid3[23]; 05109 str = "+1C7DBAADF64D9De2DA"; 05110 str >> CXSC_Pid3[24]; 05111 str = "+16CC595AEA086De2A4"; 05112 str >> CXSC_Pid3[25]; 05113 str = "+1942EC979DED29e26E"; 05114 str >> CXSC_Pid3[26]; 05115 str = "+1EFBE875957C10e238"; 05116 str >> CXSC_Pid3[27]; 05117 str = "+133B7D68BA4029e1FF"; 05118 str >> CXSC_Pid3[28]; 05119 str = "-11EB0DA382BF6Ce1C9"; 05120 str >> CXSC_Pid3[29]; 05121 str = "+1970EDF4B943FDe193"; 05122 str >> CXSC_Pid3[30]; 05123 str = "-11C6A6D14BBC74e15C"; 05124 str >> CXSC_Pid3[31]; 05125 str = "+1FBE371E3DC1D2e125"; 05126 str >> CXSC_Pid3[32]; 05127 str = "-1F34D225753A55e0EF"; 05128 str >> CXSC_Pid3[33]; 05129 str = "+1D0DA1E2E38EC1e0B7"; 05130 str >> CXSC_Pid3[34]; 05131 str = "-18C889B4CA7CA6e07E"; 05132 str >> CXSC_Pid3[35]; 05133 str = "+1B346B8DAF1FA8e048"; 05134 str >> CXSC_Pid3[36]; 05135 str = "+1326EDF35258AEe012"; 05136 str >> CXSC_Pid3[37]; 05137 str = "-1000000000DEDBe000"; 05138 str >> CXSC_Pid3[38]; 05139 str = "-1000000000DEDAe000"; 05140 str >> CXSC_Pid3[39]; 05141 05142 CXSC_Pid3_initialized = true; 05143 std::cout << RestoreOpt; 05144 } 05145 stagprec = stagmax; 05146 y = adjust(l_interval(0)); 05147 05148 for (int i=0; i<=stagmax; i++) 05149 y[i+1] = CXSC_Pid3[i]; 05150 05151 stagprec = stagsave; 05152 y = adjust(y); 05153 05154 return lx_interval(-1022,y); 05155 } // Pi/3 05156 05157 static real CXSC_SqrtPir[40]; // CXSC_SqrtPir[0], ... ,CXSC_SqrtPir[39] 05158 static bool CXSC_SqrtPir_initialized = false; 05159 05160 lx_interval SqrtPir_lx_interval() throw() 05161 // Inclusion of 1/sqrt(Pi), Blomquist, 15.06.2007; 05162 { 05163 l_interval y; 05164 int stagsave = stagprec, 05165 stagmax = 39; 05166 if (!CXSC_SqrtPir_initialized) 05167 { 05168 std::string str; 05169 std::cout << SaveOpt; 05170 std::cout << Hex; 05171 str = "+120DD750429B6De7FD"; 05172 str >> CXSC_SqrtPir[0]; 05173 str = "+11AE3A914FED80e7C5"; 05174 str >> CXSC_SqrtPir[1]; 05175 str = "-13CBBEBF65F145e78E"; 05176 str >> CXSC_SqrtPir[2]; 05177 str = "-1E0C574632F53Ee757"; 05178 str >> CXSC_SqrtPir[3]; 05179 str = "-1E6633BE9E7F15e721"; 05180 str >> CXSC_SqrtPir[4]; 05181 str = "+1CF859270F1141e6EA"; 05182 str >> CXSC_SqrtPir[5]; 05183 str = "-1FE4FB499C328Ae6B3"; 05184 str >> CXSC_SqrtPir[6]; 05185 str = "-10B82C446DC78De67C"; 05186 str >> CXSC_SqrtPir[7]; 05187 str = "-1878B089078800e646"; 05188 str >> CXSC_SqrtPir[8]; 05189 str = "-13DAEADA9E233Ee60E"; 05190 str >> CXSC_SqrtPir[9]; 05191 str = "+1137197A708BD2e5D8"; 05192 str >> CXSC_SqrtPir[10]; 05193 str = "-109009506D5BA2e59D"; 05194 str >> CXSC_SqrtPir[11]; 05195 str = "+17C9F0B5951E94e567"; 05196 str >> CXSC_SqrtPir[12]; 05197 str = "-1735F4949633A4e530"; 05198 str >> CXSC_SqrtPir[13]; 05199 str = "-146014DBC90D0Ee4FA"; 05200 str >> CXSC_SqrtPir[14]; 05201 str = "+1CAB0B222EEEA0e4C4"; 05202 str >> CXSC_SqrtPir[15]; 05203 str = "+1B1C750754B40Ae48E"; 05204 str >> CXSC_SqrtPir[16]; 05205 str = "-16B2CD2E72C16Ee456"; 05206 str >> CXSC_SqrtPir[17]; 05207 str = "-148C024FF194B2e420"; 05208 str >> CXSC_SqrtPir[18]; 05209 str = "+1CF866DD09628De3EA"; 05210 str >> CXSC_SqrtPir[19]; 05211 str = "-16CBF3DC0C536Ee3B3"; 05212 str >> CXSC_SqrtPir[20]; 05213 str = "+1EEDA3436CC85Fe37C"; 05214 str >> CXSC_SqrtPir[21]; 05215 str = "+16928D2C52986Ae346"; 05216 str >> CXSC_SqrtPir[22]; 05217 str = "+1EF82FD6BDE19De30E"; 05218 str >> CXSC_SqrtPir[23]; 05219 str = "+1218F360779AEEe2D8"; 05220 str >> CXSC_SqrtPir[24]; 05221 str = "+14F13DB14D3AC2e2A2"; 05222 str >> CXSC_SqrtPir[25]; 05223 str = "+1461BD3C8DC495e26C"; 05224 str >> CXSC_SqrtPir[26]; 05225 str = "-1CAE7855A13FF8e234"; 05226 str >> CXSC_SqrtPir[27]; 05227 str = "-18CEA8571A02F7e1FE"; 05228 str >> CXSC_SqrtPir[28]; 05229 str = "-1AC80A19057BBDe1C8"; 05230 str >> CXSC_SqrtPir[29]; 05231 str = "+1A1910D82DC198e191"; 05232 str >> CXSC_SqrtPir[30]; 05233 str = "+16B8F9198BC17Fe15B"; 05234 str >> CXSC_SqrtPir[31]; 05235 str = "+1D7B579C6CAF5De123"; 05236 str >> CXSC_SqrtPir[32]; 05237 str = "+1E97B95E80FE25e0ED"; 05238 str >> CXSC_SqrtPir[33]; 05239 str = "-188EF7630D4F86e0AF"; 05240 str >> CXSC_SqrtPir[34]; 05241 str = "+1988FBA498490Ae076"; 05242 str >> CXSC_SqrtPir[35]; 05243 str = "+178235EAEC9403e03F"; 05244 str >> CXSC_SqrtPir[36]; 05245 str = "+1067F03DFDFF93e005"; 05246 str >> CXSC_SqrtPir[37]; 05247 str = "+10000000000006e000"; 05248 str >> CXSC_SqrtPir[38]; 05249 str = "+10000000000007e000"; 05250 str >> CXSC_SqrtPir[39]; 05251 05252 CXSC_SqrtPir_initialized = true; 05253 std::cout << RestoreOpt; 05254 } 05255 stagprec = stagmax; 05256 y = adjust(l_interval(0)); 05257 05258 for (int i=0; i<=stagmax; i++) 05259 y[i+1] = CXSC_SqrtPir[i]; 05260 05261 stagprec = stagsave; 05262 y = adjust(y); 05263 05264 return lx_interval(-1023,y); 05265 } // 1/sqrt(Pi) 05266 05267 static real CXSC_Sqrt2Pir[40]; // CXSC_Sqrt2Pir[0], ... ,CXSC_Sqrt2Pir[39] 05268 static bool CXSC_Sqrt2Pir_initialized = false; 05269 05270 lx_interval Sqrt2Pir_lx_interval() throw() 05271 // Inclusion of 1/sqrt(2*Pi), Blomquist, 15.06.2007; 05272 { 05273 l_interval y; 05274 int stagsave = stagprec, 05275 stagmax = 39; 05276 if (!CXSC_Sqrt2Pir_initialized) 05277 { 05278 std::string str; 05279 std::cout << SaveOpt; 05280 std::cout << Hex; 05281 str = "+19884533D43651e7FC"; 05282 str >> CXSC_Sqrt2Pir[0]; 05283 str = "-1CBC0D30EBFD15e7C6"; 05284 str >> CXSC_Sqrt2Pir[1]; 05285 str = "-1C7402C7D60CFBe78E"; 05286 str >> CXSC_Sqrt2Pir[2]; 05287 str = "+12706D8C0471B5e756"; 05288 str >> CXSC_Sqrt2Pir[3]; 05289 str = "-1FF6718B45881De720"; 05290 str >> CXSC_Sqrt2Pir[4]; 05291 str = "-13AABB82C248DCe6EA"; 05292 str >> CXSC_Sqrt2Pir[5]; 05293 str = "-1458A899162EE4e6B1"; 05294 str >> CXSC_Sqrt2Pir[6]; 05295 str = "-14EBD8868F41EBe67A"; 05296 str >> CXSC_Sqrt2Pir[7]; 05297 str = "+13278E993445F1e642"; 05298 str >> CXSC_Sqrt2Pir[8]; 05299 str = "-1CC019F5F4780Ae60C"; 05300 str >> CXSC_Sqrt2Pir[9]; 05301 str = "+147CE4B4ECDBD7e5D6"; 05302 str >> CXSC_Sqrt2Pir[10]; 05303 str = "-19A3DCC6A3534Be59E"; 05304 str >> CXSC_Sqrt2Pir[11]; 05305 str = "+11379A7BA8CB0Ae568"; 05306 str >> CXSC_Sqrt2Pir[12]; 05307 str = "-12D909C875312Ee531"; 05308 str >> CXSC_Sqrt2Pir[13]; 05309 str = "+1C1CEC4882C77Be4FA"; 05310 str >> CXSC_Sqrt2Pir[14]; 05311 str = "-14C4078263DF36e4C4"; 05312 str >> CXSC_Sqrt2Pir[15]; 05313 str = "+1AB3FC8D2AB243e48E"; 05314 str >> CXSC_Sqrt2Pir[16]; 05315 str = "+17B9172454310Ae458"; 05316 str >> CXSC_Sqrt2Pir[17]; 05317 str = "-1444B6B781B7F2e422"; 05318 str >> CXSC_Sqrt2Pir[18]; 05319 str = "-1DB5C6773B74B7e3EC"; 05320 str >> CXSC_Sqrt2Pir[19]; 05321 str = "-12D4CD4FAB8CF9e3B5"; 05322 str >> CXSC_Sqrt2Pir[20]; 05323 str = "-12C319ACF346DCe37D"; 05324 str >> CXSC_Sqrt2Pir[21]; 05325 str = "+193ED298857CB8e346"; 05326 str >> CXSC_Sqrt2Pir[22]; 05327 str = "+1AB87659565E92e30E"; 05328 str >> CXSC_Sqrt2Pir[23]; 05329 str = "-1AEB785019F78Ee2D6"; 05330 str >> CXSC_Sqrt2Pir[24]; 05331 str = "-17DAF38DE68CA0e29F"; 05332 str >> CXSC_Sqrt2Pir[25]; 05333 str = "-14D672D025580Ce265"; 05334 str >> CXSC_Sqrt2Pir[26]; 05335 str = "-17AA87F2ABB794e22F"; 05336 str >> CXSC_Sqrt2Pir[27]; 05337 str = "+16E85953CBD917e1F9"; 05338 str >> CXSC_Sqrt2Pir[28]; 05339 str = "-10AB555C9A9735e1C3"; 05340 str >> CXSC_Sqrt2Pir[29]; 05341 str = "+1020FEB8ED1EA2e18A"; 05342 str >> CXSC_Sqrt2Pir[30]; 05343 str = "+18282C79079F71e152"; 05344 str >> CXSC_Sqrt2Pir[31]; 05345 str = "+13D282FF699FC4e11C"; 05346 str >> CXSC_Sqrt2Pir[32]; 05347 str = "-1A547E139AE10Ce0E6"; 05348 str >> CXSC_Sqrt2Pir[33]; 05349 str = "+167FCF0E311B0De0AE"; 05350 str >> CXSC_Sqrt2Pir[34]; 05351 str = "+1AC5D5E32ED719e078"; 05352 str >> CXSC_Sqrt2Pir[35]; 05353 str = "+1B311EB9071956e042"; 05354 str >> CXSC_Sqrt2Pir[36]; 05355 str = "+1D237BE89A6494e00C"; 05356 str >> CXSC_Sqrt2Pir[37]; 05357 str = "+10000000000075e000"; 05358 str >> CXSC_Sqrt2Pir[38]; 05359 str = "+10000000000076e000"; 05360 str >> CXSC_Sqrt2Pir[39]; 05361 05362 CXSC_Sqrt2Pir_initialized = true; 05363 std::cout << RestoreOpt; 05364 } 05365 stagprec = stagmax; 05366 y = adjust(l_interval(0)); 05367 05368 for (int i=0; i<=stagmax; i++) 05369 y[i+1] = CXSC_Sqrt2Pir[i]; 05370 05371 stagprec = stagsave; 05372 y = adjust(y); 05373 05374 return lx_interval(-1023,y); 05375 } // 1/sqrt(2*Pi) 05376 05377 static real CXSC_LnPi[40]; // CXSC_LnPi[0], ... ,CXSC_LnPi[39] 05378 static bool CXSC_LnPi_initialized = false; 05379 05380 lx_interval LnPi_lx_interval() throw() 05381 // Inclusion of ln(Pi), Blomquist, 15.06.2007; 05382 { 05383 l_interval y; 05384 int stagsave = stagprec, 05385 stagmax = 39; 05386 if (!CXSC_LnPi_initialized) 05387 { 05388 std::string str; 05389 std::cout << SaveOpt; 05390 std::cout << Hex; 05391 str = "+1250D048E7A1BDe7FD"; 05392 str >> CXSC_LnPi[0]; 05393 str = "+17ABF2AD8D5088e7C4"; 05394 str >> CXSC_LnPi[1]; 05395 str = "-16CCF43244818Ae78C"; 05396 str >> CXSC_LnPi[2]; 05397 str = "+1F9303719C0176e756"; 05398 str >> CXSC_LnPi[3]; 05399 str = "+15DF52611CB54Ee720"; 05400 str >> CXSC_LnPi[4]; 05401 str = "-1D9056E74F8C97e6EA"; 05402 str >> CXSC_LnPi[5]; 05403 str = "+100B095B6C2E1Ae6B3"; 05404 str >> CXSC_LnPi[6]; 05405 str = "-18C7557878A9E7e67D"; 05406 str >> CXSC_LnPi[7]; 05407 str = "+1B9BBBB4F4CEE7e646"; 05408 str >> CXSC_LnPi[8]; 05409 str = "+1B477FCC702F86e610"; 05410 str >> CXSC_LnPi[9]; 05411 str = "+141F1344A31799e5DA"; 05412 str >> CXSC_LnPi[10]; 05413 str = "+1B6740BE95CD58e5A4"; 05414 str >> CXSC_LnPi[11]; 05415 str = "-1F2C63904D27DBe56C"; 05416 str >> CXSC_LnPi[12]; 05417 str = "+1426F00B933976e534"; 05418 str >> CXSC_LnPi[13]; 05419 str = "+125703BE5FAA20e4FE"; 05420 str >> CXSC_LnPi[14]; 05421 str = "-1DADAE5397F95Be4C7"; 05422 str >> CXSC_LnPi[15]; 05423 str = "+17C9D110381543e48F"; 05424 str >> CXSC_LnPi[16]; 05425 str = "-1259230E627FCAe459"; 05426 str >> CXSC_LnPi[17]; 05427 str = "+191CEAB6B13A33e422"; 05428 str >> CXSC_LnPi[18]; 05429 str = "+109D49A13CB595e3EB"; 05430 str >> CXSC_LnPi[19]; 05431 str = "-12C574CDCD41C2e3B4"; 05432 str >> CXSC_LnPi[20]; 05433 str = "+1D4141476C3E9De37E"; 05434 str >> CXSC_LnPi[21]; 05435 str = "+1D26D892B64467e344"; 05436 str >> CXSC_LnPi[22]; 05437 str = "-16BAF3B607E1ADe30B"; 05438 str >> CXSC_LnPi[23]; 05439 str = "+165A768D8BC5ADe2D5"; 05440 str >> CXSC_LnPi[24]; 05441 str = "+12185364B32BD1e29D"; 05442 str >> CXSC_LnPi[25]; 05443 str = "-114D72550F0B90e266"; 05444 str >> CXSC_LnPi[26]; 05445 str = "+1E586BAEEB8BF4e230"; 05446 str >> CXSC_LnPi[27]; 05447 str = "-1F4B9322D4506Fe1F8"; 05448 str >> CXSC_LnPi[28]; 05449 str = "+16D32BAA9A4FCCe1C2"; 05450 str >> CXSC_LnPi[29]; 05451 str = "+1A12D8CF8CC6DAe18B"; 05452 str >> CXSC_LnPi[30]; 05453 str = "-1215CF3BD682CAe155"; 05454 str >> CXSC_LnPi[31]; 05455 str = "-184CA7D8873E45e11D"; 05456 str >> CXSC_LnPi[32]; 05457 str = "-1F02ECC3E58C6Ee0E7"; 05458 str >> CXSC_LnPi[33]; 05459 str = "-11F6EC8ED0D92Be0B1"; 05460 str >> CXSC_LnPi[34]; 05461 str = "-199F29ACE1FC18e077"; 05462 str >> CXSC_LnPi[35]; 05463 str = "+119F3673AA919Ae041"; 05464 str >> CXSC_LnPi[36]; 05465 str = "-1A8359A2831626e00A"; 05466 str >> CXSC_LnPi[37]; 05467 str = "-10000000000072e000"; 05468 str >> CXSC_LnPi[38]; 05469 str = "-10000000000071e000"; 05470 str >> CXSC_LnPi[39]; 05471 05472 CXSC_LnPi_initialized = true; 05473 std::cout << RestoreOpt; 05474 } 05475 stagprec = stagmax; 05476 y = adjust(l_interval(0)); 05477 05478 for (int i=0; i<=stagmax; i++) 05479 y[i+1] = CXSC_LnPi[i]; 05480 05481 stagprec = stagsave; 05482 y = adjust(y); 05483 05484 return lx_interval(-1022,y); 05485 } // ln(Pi) 05486 05487 static real CXSC_Ln2Pi[40]; // CXSC_Ln2Pi[0], ... ,CXSC_Ln2Pi[39] 05488 static bool CXSC_Ln2Pi_initialized = false; 05489 05490 lx_interval Ln2Pi_lx_interval() throw() 05491 // Inclusion of ln(2*Pi), Blomquist, 15.06.2007; 05492 { 05493 l_interval y; 05494 int stagsave = stagprec, 05495 stagmax = 39; 05496 if (!CXSC_Ln2Pi_initialized) 05497 { 05498 std::string str; 05499 std::cout << SaveOpt; 05500 std::cout << Hex; 05501 str = "+1D67F1C864BEB5e7FC"; 05502 str >> CXSC_Ln2Pi[0]; 05503 str = "-165B5A1B7FF5DFe7C6"; 05504 str >> CXSC_Ln2Pi[1]; 05505 str = "-1B7F70C13DC1CCe78F"; 05506 str >> CXSC_Ln2Pi[2]; 05507 str = "+13458B4DDEC6A3e759"; 05508 str >> CXSC_Ln2Pi[3]; 05509 str = "+133DAA155D2130e721"; 05510 str >> CXSC_Ln2Pi[4]; 05511 str = "-18A007FC5E501Be6EB"; 05512 str >> CXSC_Ln2Pi[5]; 05513 str = "-15406FA3AA9644e6B1"; 05514 str >> CXSC_Ln2Pi[6]; 05515 str = "-13E8D52A392CC9e67B"; 05516 str >> CXSC_Ln2Pi[7]; 05517 str = "-1A43099131E88De645"; 05518 str >> CXSC_Ln2Pi[8]; 05519 str = "-114835B6623C4De60F"; 05520 str >> CXSC_Ln2Pi[9]; 05521 str = "-1ABB7858CF827Ae5D9"; 05522 str >> CXSC_Ln2Pi[10]; 05523 str = "+1D8D7045A5A495e5A3"; 05524 str >> CXSC_Ln2Pi[11]; 05525 str = "+1A26094B3F6FC5e56C"; 05526 str >> CXSC_Ln2Pi[12]; 05527 str = "-1EF27932D0E3D0e534"; 05528 str >> CXSC_Ln2Pi[13]; 05529 str = "-12128804136AB6e4FD"; 05530 str >> CXSC_Ln2Pi[14]; 05531 str = "+15F8A4AC0BEE17e4C4"; 05532 str >> CXSC_Ln2Pi[15]; 05533 str = "+1892F2A5B69B5Fe48E"; 05534 str >> CXSC_Ln2Pi[16]; 05535 str = "+1CC7C09477ADCEe458"; 05536 str >> CXSC_Ln2Pi[17]; 05537 str = "-116DD579AF074Ae41F"; 05538 str >> CXSC_Ln2Pi[18]; 05539 str = "+190E43C1DCCD69e3E7"; 05540 str >> CXSC_Ln2Pi[19]; 05541 str = "-11F55BBD0978D3e3AF"; 05542 str >> CXSC_Ln2Pi[20]; 05543 str = "+167EC65B83F29Be378"; 05544 str >> CXSC_Ln2Pi[21]; 05545 str = "-14C0D466FC8C7Ae33C"; 05546 str >> CXSC_Ln2Pi[22]; 05547 str = "-1D56DE4860435Ce306"; 05548 str >> CXSC_Ln2Pi[23]; 05549 str = "-10C7B15DFFBDFCe2D0"; 05550 str >> CXSC_Ln2Pi[24]; 05551 str = "-15007E40803B52e299"; 05552 str >> CXSC_Ln2Pi[25]; 05553 str = "+1DF2A457B56D15e261"; 05554 str >> CXSC_Ln2Pi[26]; 05555 str = "-16B7CAD686151De22B"; 05556 str >> CXSC_Ln2Pi[27]; 05557 str = "-11F972F1A61CA1e1F5"; 05558 str >> CXSC_Ln2Pi[28]; 05559 str = "+1443CF52FBF6B4e1BE"; 05560 str >> CXSC_Ln2Pi[29]; 05561 str = "-12652AE82DC678e187"; 05562 str >> CXSC_Ln2Pi[30]; 05563 str = "-11712858901127e151"; 05564 str >> CXSC_Ln2Pi[31]; 05565 str = "+124D51F4842F1Fe11B"; 05566 str >> CXSC_Ln2Pi[32]; 05567 str = "+1B8F6B0823A92Ae0E4"; 05568 str >> CXSC_Ln2Pi[33]; 05569 str = "-1742244E0D8F40e0AB"; 05570 str >> CXSC_Ln2Pi[34]; 05571 str = "+127A8F1E2AEAD3e074"; 05572 str >> CXSC_Ln2Pi[35]; 05573 str = "-180BC6B9E8F00Ce03D"; 05574 str >> CXSC_Ln2Pi[36]; 05575 str = "+190933A24F0ECEe007"; 05576 str >> CXSC_Ln2Pi[37]; 05577 str = "-10000000000007e000"; 05578 str >> CXSC_Ln2Pi[38]; 05579 str = "-10000000000006e000"; 05580 str >> CXSC_Ln2Pi[39]; 05581 05582 CXSC_Ln2Pi_initialized = true; 05583 std::cout << RestoreOpt; 05584 } 05585 stagprec = stagmax; 05586 y = adjust(l_interval(0)); 05587 05588 for (int i=0; i<=stagmax; i++) 05589 y[i+1] = CXSC_Ln2Pi[i]; 05590 05591 stagprec = stagsave; 05592 y = adjust(y); 05593 05594 return lx_interval(-1021,y); 05595 } // ln(2*Pi) 05596 05597 static real CXSC_E[40]; // CXSC_E[0], ... ,CXSC_E[39] 05598 static bool CXSC_E_initialized = false; 05599 05600 lx_interval E_lx_interval() throw() 05601 // Inclusion of e, Blomquist, 15.06.2007; 05602 { 05603 l_interval y; 05604 int stagsave = stagprec, 05605 stagmax = 39; 05606 if (!CXSC_E_initialized) 05607 { 05608 std::string str; 05609 std::cout << SaveOpt; 05610 std::cout << Hex; 05611 str = "+15BF0A8B145769e7FD"; 05612 str >> CXSC_E[0]; 05613 str = "+14D57EE2B1013Ae7C7"; 05614 str >> CXSC_E[1]; 05615 str = "-1618713A31D3E2e78F"; 05616 str >> CXSC_E[2]; 05617 str = "+1C5A6D2B53C26De759"; 05618 str >> CXSC_E[3]; 05619 str = "-1F75CDE60219B6e723"; 05620 str >> CXSC_E[4]; 05621 str = "-188C76D93041A1e6EC"; 05622 str >> CXSC_E[5]; 05623 str = "+12FE363630C75Ee6B6"; 05624 str >> CXSC_E[6]; 05625 str = "-1C25F937F544EEe680"; 05626 str >> CXSC_E[7]; 05627 str = "-1E852C20E12A2Ae64A"; 05628 str >> CXSC_E[8]; 05629 str = "-14D4F6DE605705e60F"; 05630 str >> CXSC_E[9]; 05631 str = "-1F3225EF539355e5D5"; 05632 str >> CXSC_E[10]; 05633 str = "-16109728625547e59F"; 05634 str >> CXSC_E[11]; 05635 str = "-194301506D94CFe569"; 05636 str >> CXSC_E[12]; 05637 str = "-1879C78F8CBA44e533"; 05638 str >> CXSC_E[13]; 05639 str = "-1D5976250C1018e4FA"; 05640 str >> CXSC_E[14]; 05641 str = "+1C877C56284DABe4C4"; 05642 str >> CXSC_E[15]; 05643 str = "+1E73530ACCA4F5e48E"; 05644 str >> CXSC_E[16]; 05645 str = "-1F161A150FD53Ae458"; 05646 str >> CXSC_E[17]; 05647 str = "+159927DB0E8845e41F"; 05648 str >> CXSC_E[18]; 05649 str = "+12976591C7F773e3E9"; 05650 str >> CXSC_E[19]; 05651 str = "-1525489F280B98e3B2"; 05652 str >> CXSC_E[20]; 05653 str = "+1D4F42A3DE394Ee37A"; 05654 str >> CXSC_E[21]; 05655 str = "-16A3522431391Be341"; 05656 str >> CXSC_E[22]; 05657 str = "+1D8C8583D3E477e30B"; 05658 str >> CXSC_E[23]; 05659 str = "+14DAE13C05F9C4e2D1"; 05660 str >> CXSC_E[24]; 05661 str = "-19040E899FE5FEe29B"; 05662 str >> CXSC_E[25]; 05663 str = "+19A50685EC322Ee265"; 05664 str >> CXSC_E[26]; 05665 str = "+17F4E74C2C1FFCe22F"; 05666 str >> CXSC_E[27]; 05667 str = "+1C9E2465DDE503e1F9"; 05668 str >> CXSC_E[28]; 05669 str = "+1E1FF1D8DA637De1BF"; 05670 str >> CXSC_E[29]; 05671 str = "+1AE6776BF9785Ee189"; 05672 str >> CXSC_E[30]; 05673 str = "-1EEFFD1D38873Ee153"; 05674 str >> CXSC_E[31]; 05675 str = "-105D2F89A72197e11D"; 05676 str >> CXSC_E[32]; 05677 str = "+11360D977FD443e0E7"; 05678 str >> CXSC_E[33]; 05679 str = "+168470C23F9FBAe0B1"; 05680 str >> CXSC_E[34]; 05681 str = "-10E552624D737Ee07B"; 05682 str >> CXSC_E[35]; 05683 str = "-148879616420CCe045"; 05684 str >> CXSC_E[36]; 05685 str = "-1FEE3CF25C81B1e00F"; 05686 str >> CXSC_E[37]; 05687 str = "-10000000001233e000"; 05688 str >> CXSC_E[38]; 05689 str = "-10000000001232e000"; 05690 str >> CXSC_E[39]; 05691 05692 CXSC_E_initialized = true; 05693 std::cout << RestoreOpt; 05694 } 05695 stagprec = stagmax; 05696 y = adjust(l_interval(0)); 05697 05698 for (int i=0; i<=stagmax; i++) 05699 y[i+1] = CXSC_E[i]; 05700 05701 stagprec = stagsave; 05702 y = adjust(y); 05703 05704 return lx_interval(-1021,y); 05705 } // e 05706 05707 static real CXSC_EpPi[40]; // CXSC_EpPi[0], ... ,CXSC_EpPi[39] 05708 static bool CXSC_EpPi_initialized = false; 05709 05710 lx_interval EpPi_lx_interval() throw() 05711 // Inclusion of e^Pi, Blomquist, 15.06.2007; 05712 { 05713 l_interval y; 05714 int stagsave = stagprec, 05715 stagmax = 39; 05716 if (!CXSC_EpPi_initialized) 05717 { 05718 std::string str; 05719 std::cout << SaveOpt; 05720 std::cout << Hex; 05721 str = "+1724046EB0933Ae7FD"; 05722 str >> CXSC_EpPi[0]; 05723 str = "-184C962DD81952e7C7"; 05724 str >> CXSC_EpPi[1]; 05725 str = "-12D659C0BCD22Ee790"; 05726 str >> CXSC_EpPi[2]; 05727 str = "+117496B8A92F91e75A"; 05728 str >> CXSC_EpPi[3]; 05729 str = "+16A8C4203E5FCDe724"; 05730 str >> CXSC_EpPi[4]; 05731 str = "-166B11F99A663Be6EE"; 05732 str >> CXSC_EpPi[5]; 05733 str = "-118EC2076DABB1e6B8"; 05734 str >> CXSC_EpPi[6]; 05735 str = "+19776E5BEB18A5e682"; 05736 str >> CXSC_EpPi[7]; 05737 str = "+1AD4091E84B051e64C"; 05738 str >> CXSC_EpPi[8]; 05739 str = "+1E89AA12909B40e616"; 05740 str >> CXSC_EpPi[9]; 05741 str = "+1ACE3C0DDBB994e5DD"; 05742 str >> CXSC_EpPi[10]; 05743 str = "+141EC9379CBBFEe5A6"; 05744 str >> CXSC_EpPi[11]; 05745 str = "+1FC4E78D00A016e56D"; 05746 str >> CXSC_EpPi[12]; 05747 str = "+1608BE35B9A409e537"; 05748 str >> CXSC_EpPi[13]; 05749 str = "-1A0D8AA90EB6B9e4FD"; 05750 str >> CXSC_EpPi[14]; 05751 str = "+106FE8AFD21ACFe4C7"; 05752 str >> CXSC_EpPi[15]; 05753 str = "+1C072FEA1BFCAFe48F"; 05754 str >> CXSC_EpPi[16]; 05755 str = "+1915B9F352EC68e455"; 05756 str >> CXSC_EpPi[17]; 05757 str = "-13FA07C37897E9e41E"; 05758 str >> CXSC_EpPi[18]; 05759 str = "-1EC01C89B8DDFFe3E8"; 05760 str >> CXSC_EpPi[19]; 05761 str = "+1EDC3A402336AFe3B0"; 05762 str >> CXSC_EpPi[20]; 05763 str = "-12677080620EA5e378"; 05764 str >> CXSC_EpPi[21]; 05765 str = "-1C63FD21D891DEe340"; 05766 str >> CXSC_EpPi[22]; 05767 str = "-1FB6165FFF8730e309"; 05768 str >> CXSC_EpPi[23]; 05769 str = "-177AB93E2523EFe2D3"; 05770 str >> CXSC_EpPi[24]; 05771 str = "+16D78E0B522E2Ce29C"; 05772 str >> CXSC_EpPi[25]; 05773 str = "-17473D7DD61EBEe266"; 05774 str >> CXSC_EpPi[26]; 05775 str = "-1F082665C53E27e22A"; 05776 str >> CXSC_EpPi[27]; 05777 str = "-17CDF823ACB5D6e1F3"; 05778 str >> CXSC_EpPi[28]; 05779 str = "-1D95D856C4BF74e1BC"; 05780 str >> CXSC_EpPi[29]; 05781 str = "-1327665D26E23Ae186"; 05782 str >> CXSC_EpPi[30]; 05783 str = "-1EC5804BDCCA81e150"; 05784 str >> CXSC_EpPi[31]; 05785 str = "-1C73760E976CC3e117"; 05786 str >> CXSC_EpPi[32]; 05787 str = "-10B1DCE92BE86Ce0E0"; 05788 str >> CXSC_EpPi[33]; 05789 str = "-17372866D0A1CCe0AA"; 05790 str >> CXSC_EpPi[34]; 05791 str = "-15510B0AF58D1Ee074"; 05792 str >> CXSC_EpPi[35]; 05793 str = "+1B9820D80B02D9e03C"; 05794 str >> CXSC_EpPi[36]; 05795 str = "-17765315D853BAe002"; 05796 str >> CXSC_EpPi[37]; 05797 str = "-10000000000001e000"; 05798 str >> CXSC_EpPi[38]; 05799 str = "-10000000000000e000"; 05800 str >> CXSC_EpPi[39]; 05801 05802 CXSC_EpPi_initialized = true; 05803 std::cout << RestoreOpt; 05804 } 05805 stagprec = stagmax; 05806 y = adjust(l_interval(0)); 05807 05808 for (int i=0; i<=stagmax; i++) 05809 y[i+1] = CXSC_EpPi[i]; 05810 05811 stagprec = stagsave; 05812 y = adjust(y); 05813 05814 return lx_interval(-1018,y); 05815 } // e^Pi 05816 05817 static real CXSC_EulerGamma[40]; // CXSC_EulerGamma[0],...,CXSC_EulerGamma[39] 05818 static bool CXSC_EulerGamma_initialized = false; 05819 05820 lx_interval EulerGamma_lx_interval() throw() 05821 // Inclusion of EulerGamma, Blomquist, 15.06.2007; 05822 { 05823 l_interval y; 05824 int stagsave = stagprec, 05825 stagmax = 39; 05826 if (!CXSC_EulerGamma_initialized) 05827 { 05828 std::string str; 05829 std::cout << SaveOpt; 05830 std::cout << Hex; 05831 str = "+12788CFC6FB619e7FD"; 05832 str >> CXSC_EulerGamma[0]; 05833 str = "-16CB90701FBFABe7C4"; 05834 str >> CXSC_EulerGamma[1]; 05835 str = "-134A95E3133C51e78E"; 05836 str >> CXSC_EulerGamma[2]; 05837 str = "+19730064300F7De758"; 05838 str >> CXSC_EulerGamma[3]; 05839 str = "-171ECA0084E369e721"; 05840 str >> CXSC_EulerGamma[4]; 05841 str = "-1302FE2B078898e6EB"; 05842 str >> CXSC_EulerGamma[5]; 05843 str = "+192732D88415F4e6B4"; 05844 str >> CXSC_EulerGamma[6]; 05845 str = "+11056AE9132136e67E"; 05846 str >> CXSC_EulerGamma[7]; 05847 str = "-17DC6F12E630A3e648"; 05848 str >> CXSC_EulerGamma[8]; 05849 str = "+175FD4B1BD70F2e611"; 05850 str >> CXSC_EulerGamma[9]; 05851 str = "-19BC9466120C20e5DB"; 05852 str >> CXSC_EulerGamma[10]; 05853 str = "-18FD5699260EADe5A5"; 05854 str >> CXSC_EulerGamma[11]; 05855 str = "-12EA987665551Fe56E"; 05856 str >> CXSC_EulerGamma[12]; 05857 str = "-1FB159BA4A423De537"; 05858 str >> CXSC_EulerGamma[13]; 05859 str = "+1FA543D43BCC60e501"; 05860 str >> CXSC_EulerGamma[14]; 05861 str = "-1E6F04E0F639F6e4C8"; 05862 str >> CXSC_EulerGamma[15]; 05863 str = "-1A23768654F43De490"; 05864 str >> CXSC_EulerGamma[16]; 05865 str = "-14F1C5CB4F55EBe457"; 05866 str >> CXSC_EulerGamma[17]; 05867 str = "+1E71DF52EDAA7Fe41F"; 05868 str >> CXSC_EulerGamma[18]; 05869 str = "+1C398F9B427E3Fe3E8"; 05870 str >> CXSC_EulerGamma[19]; 05871 str = "+1432C7402B3D24e3AF"; 05872 str >> CXSC_EulerGamma[20]; 05873 str = "-1810CF88C5F0D1e377"; 05874 str >> CXSC_EulerGamma[21]; 05875 str = "-1E9610AE5B38C5e340"; 05876 str >> CXSC_EulerGamma[22]; 05877 str = "+18220365594965e30A"; 05878 str >> CXSC_EulerGamma[23]; 05879 str = "-11F19DA40D550De2D4"; 05880 str >> CXSC_EulerGamma[24]; 05881 str = "+1936632B38107Ee29D"; 05882 str >> CXSC_EulerGamma[25]; 05883 str = "+11569F72C8E198e267"; 05884 str >> CXSC_EulerGamma[26]; 05885 str = "-1534E2EDC357EAe230"; 05886 str >> CXSC_EulerGamma[27]; 05887 str = "-126925B08D68FFe1F7"; 05888 str >> CXSC_EulerGamma[28]; 05889 str = "-1F62F86B1E6840e1C0"; 05890 str >> CXSC_EulerGamma[29]; 05891 str = "+133239C12DF171e188"; 05892 str >> CXSC_EulerGamma[30]; 05893 str = "+17E60989B189E2e14D"; 05894 str >> CXSC_EulerGamma[31]; 05895 str = "+1F6FB023E2AA98e117"; 05896 str >> CXSC_EulerGamma[32]; 05897 str = "+16911C6C6708F0e0DF"; 05898 str >> CXSC_EulerGamma[33]; 05899 str = "-1B7B61C9327A74e0A9"; 05900 str >> CXSC_EulerGamma[34]; 05901 str = "-16E397C5D924C3e073"; 05902 str >> CXSC_EulerGamma[35]; 05903 str = "-1435DBEDE3F382e03C"; 05904 str >> CXSC_EulerGamma[36]; 05905 str = "+1C0AEA1C4BB6FFe006"; 05906 str >> CXSC_EulerGamma[37]; 05907 str = "-1000000000000Ee000"; 05908 str >> CXSC_EulerGamma[38]; 05909 str = "-1000000000000De000"; 05910 str >> CXSC_EulerGamma[39]; 05911 05912 CXSC_EulerGamma_initialized = true; 05913 std::cout << RestoreOpt; 05914 } 05915 stagprec = stagmax; 05916 y = adjust(l_interval(0)); 05917 05918 for (int i=0; i<=stagmax; i++) 05919 y[i+1] = CXSC_EulerGamma[i]; 05920 05921 stagprec = stagsave; 05922 y = adjust(y); 05923 05924 return lx_interval(-1023,y); 05925 } // EulerGamma 05926 05927 static real CXSC_Catalan[40]; // CXSC_Catalan[0],...,CXSC_Catalan[39] 05928 static bool CXSC_Catalan_initialized = false; 05929 05930 lx_interval Catalan_lx_interval() throw() 05931 // Inclusion of Catalan, Blomquist, 15.06.2007; 05932 { 05933 l_interval y; 05934 int stagsave = stagprec, 05935 stagmax = 39; 05936 if (!CXSC_Catalan_initialized) 05937 { 05938 std::string str; 05939 std::cout << SaveOpt; 05940 std::cout << Hex; 05941 str = "+1D4F9713E8135De7FC"; 05942 str >> CXSC_Catalan[0]; 05943 str = "+11485608B8DF4De7C3"; 05944 str >> CXSC_Catalan[1]; 05945 str = "-12F39C13BC1EC8e78D"; 05946 str >> CXSC_Catalan[2]; 05947 str = "+1C2FF8094A263Ee755"; 05948 str >> CXSC_Catalan[3]; 05949 str = "+168F335DBE5370e71F"; 05950 str >> CXSC_Catalan[4]; 05951 str = "+16291BBB16163Ee6E7"; 05952 str >> CXSC_Catalan[5]; 05953 str = "+124D663F739C43e6B1"; 05954 str >> CXSC_Catalan[6]; 05955 str = "-136A0725ED0E94e679"; 05956 str >> CXSC_Catalan[7]; 05957 str = "-1D3A26F9C06FCEe63E"; 05958 str >> CXSC_Catalan[8]; 05959 str = "-164E42486BFCD2e607"; 05960 str >> CXSC_Catalan[9]; 05961 str = "+14F358CFDEC843e5D1"; 05962 str >> CXSC_Catalan[10]; 05963 str = "-11EB82210976ABe59B"; 05964 str >> CXSC_Catalan[11]; 05965 str = "-17D31F6DF5E801e565"; 05966 str >> CXSC_Catalan[12]; 05967 str = "+13FD19CE3E396Ae52F"; 05968 str >> CXSC_Catalan[13]; 05969 str = "-1C8CBB3852FF3Fe4F6"; 05970 str >> CXSC_Catalan[14]; 05971 str = "+1A86EB34EAD01Ae4C0"; 05972 str >> CXSC_Catalan[15]; 05973 str = "+1C68C37800513Be485"; 05974 str >> CXSC_Catalan[16]; 05975 str = "+1D46EBB334D7C9e44E"; 05976 str >> CXSC_Catalan[17]; 05977 str = "-1944C5E2711625e417"; 05978 str >> CXSC_Catalan[18]; 05979 str = "-17885C649BB92Fe3E1"; 05980 str >> CXSC_Catalan[19]; 05981 str = "+1A2A0CEE24DD91e3A9"; 05982 str >> CXSC_Catalan[20]; 05983 str = "+159AEC52EB2869e372"; 05984 str >> CXSC_Catalan[21]; 05985 str = "-1D26976389F1E1e339"; 05986 str >> CXSC_Catalan[22]; 05987 str = "+1E9AF9FF2E2FB1e302"; 05988 str >> CXSC_Catalan[23]; 05989 str = "+1E8B66677323FEe2CC"; 05990 str >> CXSC_Catalan[24]; 05991 str = "+164BBD8A306F6Ae296"; 05992 str >> CXSC_Catalan[25]; 05993 str = "-1EE36A15C4872Be25F"; 05994 str >> CXSC_Catalan[26]; 05995 str = "+1C3A35B39DC2FFe228"; 05996 str >> CXSC_Catalan[27]; 05997 str = "-1CCAF1572CDFC2e1F1"; 05998 str >> CXSC_Catalan[28]; 05999 str = "+15FB135902BFEEe1BA"; 06000 str >> CXSC_Catalan[29]; 06001 str = "+19FDE4873721BAe183"; 06002 str >> CXSC_Catalan[30]; 06003 str = "-17ABB7B5115456e14D"; 06004 str >> CXSC_Catalan[31]; 06005 str = "+1458F7F79FA825e117"; 06006 str >> CXSC_Catalan[32]; 06007 str = "-1416ED1E24CEFDe0E1"; 06008 str >> CXSC_Catalan[33]; 06009 str = "+15A6293C127A02e0A9"; 06010 str >> CXSC_Catalan[34]; 06011 str = "-1F1AABC6E5593Ce073"; 06012 str >> CXSC_Catalan[35]; 06013 str = "+1A7A8FB50B3479e03D"; 06014 str >> CXSC_Catalan[36]; 06015 str = "+1B853813268EF2e005"; 06016 str >> CXSC_Catalan[37]; 06017 str = "+10000000000003e000"; 06018 str >> CXSC_Catalan[38]; 06019 str = "+10000000000004e000"; 06020 str >> CXSC_Catalan[39]; 06021 06022 CXSC_Catalan_initialized = true; 06023 std::cout << RestoreOpt; 06024 } 06025 stagprec = stagmax; 06026 y = adjust(l_interval(0)); 06027 06028 for (int i=0; i<=stagmax; i++) 06029 y[i+1] = CXSC_Catalan[i]; 06030 06031 stagprec = stagsave; 06032 y = adjust(y); 06033 06034 return lx_interval(-1022,y); 06035 } // Catalan 06036 06037 static real CXSC_sqrt5[40]; // CXSC_sqrt5[0],...,CXSC_sqrt5[39] 06038 static bool CXSC_sqrt5_initialized = false; 06039 06040 lx_interval sqrt5_lx_interval() throw() 06041 // Inclusion of sqrt(5), Blomquist, 15.06.2007; 06042 { 06043 l_interval y; 06044 int stagsave = stagprec, 06045 stagmax = 39; 06046 if (!CXSC_sqrt5_initialized) 06047 { 06048 std::string str; 06049 std::cout << SaveOpt; 06050 std::cout << Hex; 06051 str = "+11E3779B97F4A8e7FD"; 06052 str >> CXSC_sqrt5[0]; 06053 str = "-1F506319FCFD19e7C6"; 06054 str >> CXSC_sqrt5[1]; 06055 str = "+1B906821044ED8e790"; 06056 str >> CXSC_sqrt5[2]; 06057 str = "-18BB1B5C0F272Ce758"; 06058 str >> CXSC_sqrt5[3]; 06059 str = "+11D0C18E952768e721"; 06060 str >> CXSC_sqrt5[4]; 06061 str = "-1E9D585B0901F9e6E8"; 06062 str >> CXSC_sqrt5[5]; 06063 str = "-1C7DD252073EC0e6B2"; 06064 str >> CXSC_sqrt5[6]; 06065 str = "-1FCEF21EDAF7FAe67C"; 06066 str >> CXSC_sqrt5[7]; 06067 str = "+160EB25D20799Be63E"; 06068 str >> CXSC_sqrt5[8]; 06069 str = "-1C90F95285168Fe605"; 06070 str >> CXSC_sqrt5[9]; 06071 str = "+1E1DFA160E75BCe5CF"; 06072 str >> CXSC_sqrt5[10]; 06073 str = "-10A08E66CB368Ce593"; 06074 str >> CXSC_sqrt5[11]; 06075 str = "+1C5371682CADD1e55D"; 06076 str >> CXSC_sqrt5[12]; 06077 str = "-1998100220F4EDe526"; 06078 str >> CXSC_sqrt5[13]; 06079 str = "+1C6771A0968663e4F0"; 06080 str >> CXSC_sqrt5[14]; 06081 str = "+1DFB9E3C86CA7Ce4BA"; 06082 str >> CXSC_sqrt5[15]; 06083 str = "-18AE38ED5304B1e483"; 06084 str >> CXSC_sqrt5[16]; 06085 str = "+182A5FEC507706e44D"; 06086 str >> CXSC_sqrt5[17]; 06087 str = "-1B5191A18C5647e415"; 06088 str >> CXSC_sqrt5[18]; 06089 str = "+1F3AA4DB287AE4e3DD"; 06090 str >> CXSC_sqrt5[19]; 06091 str = "+13CCCBA48E9CF3e3A7"; 06092 str >> CXSC_sqrt5[20]; 06093 str = "-1BA6DC6F5C5A29e36F"; 06094 str >> CXSC_sqrt5[21]; 06095 str = "-1C87E14FE4B628e339"; 06096 str >> CXSC_sqrt5[22]; 06097 str = "+19D3E854210678e303"; 06098 str >> CXSC_sqrt5[23]; 06099 str = "+1D54807166A5B3e2CC"; 06100 str >> CXSC_sqrt5[24]; 06101 str = "+1D6987A242DB8De296"; 06102 str >> CXSC_sqrt5[25]; 06103 str = "+11DEC88A541BA8e260"; 06104 str >> CXSC_sqrt5[26]; 06105 str = "+1B91971F345A99e228"; 06106 str >> CXSC_sqrt5[27]; 06107 str = "-1758726EB11AAFe1F2"; 06108 str >> CXSC_sqrt5[28]; 06109 str = "+115613474B3372e1BA"; 06110 str >> CXSC_sqrt5[29]; 06111 str = "+150CCED228BEBFe184"; 06112 str >> CXSC_sqrt5[30]; 06113 str = "-13BFAB17A99623e14E"; 06114 str >> CXSC_sqrt5[31]; 06115 str = "-17397D0B07EFCEe115"; 06116 str >> CXSC_sqrt5[32]; 06117 str = "+157D728069CE1Ee0DC"; 06118 str >> CXSC_sqrt5[33]; 06119 str = "+10B046030D58E1e0A6"; 06120 str >> CXSC_sqrt5[34]; 06121 str = "-1A8870A118821Ce06E"; 06122 str >> CXSC_sqrt5[35]; 06123 str = "-1BD96261F224FBe038"; 06124 str >> CXSC_sqrt5[36]; 06125 str = "+1FDBEC758D20C8e002"; 06126 str >> CXSC_sqrt5[37]; 06127 str = "+10000000000000e000"; 06128 str >> CXSC_sqrt5[38]; 06129 str = "+10000000000001e000"; 06130 str >> CXSC_sqrt5[39]; 06131 06132 CXSC_sqrt5_initialized = true; 06133 std::cout << RestoreOpt; 06134 } 06135 stagprec = stagmax; 06136 y = adjust(l_interval(0)); 06137 06138 for (int i=0; i<=stagmax; i++) 06139 y[i+1] = CXSC_sqrt5[i]; 06140 06141 stagprec = stagsave; 06142 y = adjust(y); 06143 06144 return lx_interval(-1021,y); 06145 } // sqrt(5) 06146 06147 static real CXSC_sqrt7[40]; // CXSC_sqrt7[0],...,CXSC_sqrt7[39] 06148 static bool CXSC_sqrt7_initialized = false; 06149 06150 lx_interval sqrt7_lx_interval() throw() 06151 // Inclusion of sqrt(7), Blomquist, 15.06.2007; 06152 { 06153 l_interval y; 06154 int stagsave = stagprec, 06155 stagmax = 39; 06156 if (!CXSC_sqrt7_initialized) 06157 { 06158 std::string str; 06159 std::cout << SaveOpt; 06160 std::cout << Hex; 06161 str = "+152A7FA9D2F8EAe7FD"; 06162 str >> CXSC_sqrt7[0]; 06163 str = "-121C62B033C079e7C7"; 06164 str >> CXSC_sqrt7[1]; 06165 str = "-177CAAD6200612e78E"; 06166 str >> CXSC_sqrt7[2]; 06167 str = "-1EFA880DC72D64e756"; 06168 str >> CXSC_sqrt7[3]; 06169 str = "-171D206D5B1A4Ce71C"; 06170 str >> CXSC_sqrt7[4]; 06171 str = "+119392FA9B0494e6E3"; 06172 str >> CXSC_sqrt7[5]; 06173 str = " +17BB8A64890057e6AA"; 06174 str >> CXSC_sqrt7[6]; 06175 str = "-17E89300383DDEe674"; 06176 str >> CXSC_sqrt7[7]; 06177 str = "+130FB7AF68A6FBe63E"; 06178 str >> CXSC_sqrt7[8]; 06179 str = "+1322281D303D36e606"; 06180 str >> CXSC_sqrt7[9]; 06181 str = "+1996109A16D3B1e5D0"; 06182 str >> CXSC_sqrt7[10]; 06183 str = "+1F239C301DFBB4e599"; 06184 str >> CXSC_sqrt7[11]; 06185 str = "-1B5CA40AB771A2e560"; 06186 str >> CXSC_sqrt7[12]; 06187 str = "-1675711487FEAAe527"; 06188 str >> CXSC_sqrt7[13]; 06189 str = "+122CB7FA26ABA5e4F1"; 06190 str >> CXSC_sqrt7[14]; 06191 str = "+1059211B7D5398e4BA"; 06192 str >> CXSC_sqrt7[15]; 06193 str = "-10F15BFA46EB7Fe484"; 06194 str >> CXSC_sqrt7[16]; 06195 str = "+15AB71566CE72Be44E"; 06196 str >> CXSC_sqrt7[17]; 06197 str = "-1386BDCA3845C7e417"; 06198 str >> CXSC_sqrt7[18]; 06199 str = "+158978E1A883F0e3E1"; 06200 str >> CXSC_sqrt7[19]; 06201 str = "+1F8A772604CAF1e3AB"; 06202 str >> CXSC_sqrt7[20]; 06203 str = "-169730DF195425e374"; 06204 str >> CXSC_sqrt7[21]; 06205 str = "+121341C1C58312e33D"; 06206 str >> CXSC_sqrt7[22]; 06207 str = "+1117A6A8D5A423e307"; 06208 str >> CXSC_sqrt7[23]; 06209 str = "-12D6F266C4AE34e2D0"; 06210 str >> CXSC_sqrt7[24]; 06211 str = "-1B8D3340BC4497e299"; 06212 str >> CXSC_sqrt7[25]; 06213 str = "-1E0712BA5C43CFe263"; 06214 str >> CXSC_sqrt7[26]; 06215 str = "+14BF59F22FDCEDe22D"; 06216 str >> CXSC_sqrt7[27]; 06217 str = "-189028E9147846e1F3"; 06218 str >> CXSC_sqrt7[28]; 06219 str = "-1BBE8044991D23e1BB"; 06220 str >> CXSC_sqrt7[29]; 06221 str = "+1B07A12AB80C0Ae185"; 06222 str >> CXSC_sqrt7[30]; 06223 str = "+1970A29C5148A7e14E"; 06224 str >> CXSC_sqrt7[31]; 06225 str = "-18DBF939495F77e117"; 06226 str >> CXSC_sqrt7[32]; 06227 str = "-1865ECB3F101B4e0E1"; 06228 str >> CXSC_sqrt7[33]; 06229 str = "-1DCDFCFE6050DFe0A4"; 06230 str >> CXSC_sqrt7[34]; 06231 str = "+1E635021BBF848e06B"; 06232 str >> CXSC_sqrt7[35]; 06233 str = "+15C53CF344AF94e035"; 06234 str >> CXSC_sqrt7[36]; 06235 str = "+124CB182B20E69e000"; 06236 str >> CXSC_sqrt7[37]; 06237 str = "-10000000000001e000"; 06238 str >> CXSC_sqrt7[38]; 06239 str = "-10000000000000e000"; 06240 str >> CXSC_sqrt7[39]; 06241 06242 CXSC_sqrt7_initialized = true; 06243 std::cout << RestoreOpt; 06244 } 06245 stagprec = stagmax; 06246 y = adjust(l_interval(0)); 06247 06248 for (int i=0; i<=stagmax; i++) 06249 y[i+1] = CXSC_sqrt7[i]; 06250 06251 stagprec = stagsave; 06252 y = adjust(y); 06253 06254 return lx_interval(-1021,y); 06255 } // sqrt(7) 06256 06257 static real CXSC_One_m[3]; // CXSC_One_m[0], ... ,CXSC_One_m[2] 06258 static bool CXSC_One_m_initialized = false; 06259 06260 lx_interval One_m_lx_interval() throw() 06261 // Inclusion of 2^(-1023)*(2^(+1023) - 2^(-1074)) = 1-2^(-2097), 06262 // Blomquist, 26.07.2007; 06263 { 06264 l_interval y; 06265 int stagsave = stagprec, 06266 stagmax = 2; 06267 06268 if (!CXSC_One_m_initialized) 06269 { 06270 std::string str; 06271 std::cout << SaveOpt; 06272 std::cout << Hex; 06273 str = "+10000000000000e7FE"; 06274 str >> CXSC_One_m[0]; 06275 str = "-10000000000001e000"; 06276 str >> CXSC_One_m[1]; 06277 str = "-10000000000001e000"; 06278 str >> CXSC_One_m[2]; 06279 CXSC_One_m_initialized = true; 06280 std::cout << RestoreOpt; 06281 } 06282 stagprec = stagmax; 06283 y = adjust(l_interval(0)); 06284 06285 for (int i=0; i<=stagmax; i++) 06286 y[i+1] = CXSC_One_m[i]; 06287 06288 stagprec = stagsave; 06289 y = adjust(y); 06290 06291 return lx_interval(-1023,y); 06292 } // One_m_lx_interval() 06293 06294 static real CXSC_One_p[3]; // CXSC_One_p[0], ... ,CXSC_One_p[2] 06295 static bool CXSC_One_p_initialized = false; 06296 06297 lx_interval One_p_lx_interval() throw() 06298 // Inclusion of 2^(-1023)*(2^(+1023) + 2^(-1074)) = 1+2^(-2097), 06299 // Blomquist, 27.07.2007; 06300 { 06301 l_interval y; 06302 int stagsave = stagprec, 06303 stagmax = 2; 06304 06305 if (!CXSC_One_p_initialized) 06306 { 06307 std::string str; 06308 std::cout << SaveOpt; 06309 std::cout << Hex; 06310 str = "+10000000000000e7FE"; 06311 str >> CXSC_One_p[0]; 06312 str = "+10000000000001e000"; 06313 str >> CXSC_One_p[1]; 06314 str = "+10000000000001e000"; 06315 str >> CXSC_One_p[2]; 06316 CXSC_One_p_initialized = true; 06317 std::cout << RestoreOpt; 06318 } 06319 stagprec = stagmax; 06320 y = adjust(l_interval(0)); 06321 06322 for (int i=0; i<=stagmax; i++) 06323 y[i+1] = CXSC_One_p[i]; 06324 06325 stagprec = stagsave; 06326 y = adjust(y); 06327 06328 return lx_interval(-1023,y); 06329 } // One_p_lx_interval() 06330 06331 static real CXSC_Ln10r[40]; // CXSC_Ln10r[0], ... ,CXSC_Ln10r[39] 06332 static bool CXSC_Ln10r_initialized = false; 06333 06334 lx_interval Ln10r_lx_interval() throw() 06335 // Inclusion of 1/ln(10), Blomquist, 27.11.2008; 06336 { 06337 l_interval y; 06338 int stagsave = stagprec, 06339 stagmax = 39; 06340 if (!CXSC_Ln10r_initialized) 06341 { 06342 std::string str; 06343 std::cout << SaveOpt; 06344 std::cout << Hex; 06345 str = "+1BCB7B1526E50Ee7FC"; 06346 str >> CXSC_Ln10r[0]; 06347 str = "+195355BAAAFAD3e7C5"; 06348 str >> CXSC_Ln10r[1]; 06349 str = "+1EE191F71A3012e78E"; 06350 str >> CXSC_Ln10r[2]; 06351 str = "+17268808E8FCB5e757"; 06352 str >> CXSC_Ln10r[3]; 06353 str = "+13DE3A94F1D509e71F"; 06354 str >> CXSC_Ln10r[4]; 06355 str = "+1DF42805E7E524e6E8"; 06356 str >> CXSC_Ln10r[5]; 06357 str = "+11AAC96323250Be6B2"; 06358 str >> CXSC_Ln10r[6]; 06359 str = "-1CE63884C058E4e67C"; 06360 str >> CXSC_Ln10r[7]; 06361 str = "-1A1C82EA3969BAe646"; 06362 str >> CXSC_Ln10r[8]; 06363 str = "+1B4F6686AD7A33e610"; 06364 str >> CXSC_Ln10r[9]; 06365 str = "-1B97C8035FFC70e5DA"; 06366 str >> CXSC_Ln10r[10]; 06367 str = "+1630771369962Ee59F"; 06368 str >> CXSC_Ln10r[11]; 06369 str = "-1E15BD37B295AFe569"; 06370 str >> CXSC_Ln10r[12]; 06371 str = "-132484B432318Be533"; 06372 str >> CXSC_Ln10r[13]; 06373 str = "+15430212AE68C0e4FD"; 06374 str >> CXSC_Ln10r[14]; 06375 str = "+1351923B322731e4C7"; 06376 str >> CXSC_Ln10r[15]; 06377 str = "+11F934D794D64Fe491"; 06378 str >> CXSC_Ln10r[16]; 06379 str = "+13E4B475D9FF20e45A"; 06380 str >> CXSC_Ln10r[17]; 06381 str = "+185D9B63ED9A24e424"; 06382 str >> CXSC_Ln10r[18]; 06383 str = "+1ADC650C65E948e3ED"; 06384 str >> CXSC_Ln10r[19]; 06385 str = "-1149FBC70C04EAe3B6"; 06386 str >> CXSC_Ln10r[20]; 06387 str = "+1056270A8CDF9Ce380"; 06388 str >> CXSC_Ln10r[21]; 06389 str = "-1D339476D1076Fe34A"; 06390 str >> CXSC_Ln10r[22]; 06391 str = "-1635343A8B5E85e314"; 06392 str >> CXSC_Ln10r[23]; 06393 str = "+1DB78151377249e2DC"; 06394 str >> CXSC_Ln10r[24]; 06395 str = "+14DD9BD4601639e2A6"; 06396 str >> CXSC_Ln10r[25]; 06397 str = "+1D545BF0E9F470e26F"; 06398 str >> CXSC_Ln10r[26]; 06399 str = "+17CC4CE204C9F6e239"; 06400 str >> CXSC_Ln10r[27]; 06401 str = "+10CED2851AF1ABe200"; 06402 str >> CXSC_Ln10r[28]; 06403 str = "-16C9D9EB4EF234e1C9"; 06404 str >> CXSC_Ln10r[29]; 06405 str = "-1D67966CCC4205e192"; 06406 str >> CXSC_Ln10r[30]; 06407 str = "-1A83D3193C0A22e15C"; 06408 str >> CXSC_Ln10r[31]; 06409 str = "-17066494F5F3BEe126"; 06410 str >> CXSC_Ln10r[32]; 06411 str = "+12A7753E2FBCACe0F0"; 06412 str >> CXSC_Ln10r[33]; 06413 str = "+1FE8D8E367317Be0BA"; 06414 str >> CXSC_Ln10r[34]; 06415 str = "+12BB8A7F6B3745e084"; 06416 str >> CXSC_Ln10r[35]; 06417 str = "+1D906BB4F052BDe04B"; 06418 str >> CXSC_Ln10r[36]; 06419 str = "+1FEED057798219e013"; 06420 str >> CXSC_Ln10r[37]; 06421 str = "+100000000010E1e000"; 06422 str >> CXSC_Ln10r[38]; 06423 str = "+100000000010E2e000"; 06424 str >> CXSC_Ln10r[39]; 06425 06426 CXSC_Ln10r_initialized = true; 06427 std::cout << RestoreOpt; 06428 } 06429 stagprec = stagmax; 06430 y = adjust(l_interval(0)); 06431 06432 for (int i=0; i<=stagmax; i++) 06433 y[i+1] = CXSC_Ln10r[i]; 06434 06435 stagprec = stagsave; 06436 y = adjust(y); 06437 06438 return lx_interval(-1023,y); 06439 } // 1/ln(10) 06440 06441 // ************************************************************************** 06442 06443 static real CXSC_Pid4[40]; // CXSC_Pid4[0], ... ,CXSC_Pid4[39] 06444 static bool CXSC_Pid4_initialized = false; 06445 06446 lx_interval Pid4_lx_interval() throw() 06447 // Inclusion of 1/ln(10), Blomquist, 27.11.2008; 06448 { 06449 l_interval y; 06450 int stagsave = stagprec, 06451 stagmax = 39; 06452 if (!CXSC_Pid4_initialized) 06453 { 06454 std::string str; 06455 std::cout << SaveOpt; 06456 std::cout << Hex; 06457 str = "+1921FB54442D18e7FC"; 06458 str >> CXSC_Pid4[0]; 06459 str = "+11A62633145C07e7C6"; 06460 str >> CXSC_Pid4[1]; 06461 str = "-1F1976B7ED8FBCe78E"; 06462 str >> CXSC_Pid4[2]; 06463 str = "+14CF98E804177De758"; 06464 str >> CXSC_Pid4[3]; 06465 str = "+131D89CD9128A5e722"; 06466 str >> CXSC_Pid4[4]; 06467 str = "+10F31C6809BBDFe6E8"; 06468 str >> CXSC_Pid4[5]; 06469 str = "+1519B3CD3A431Be6B1"; 06470 str >> CXSC_Pid4[6]; 06471 str = "+18158536F92F8Ae67A"; 06472 str >> CXSC_Pid4[7]; 06473 str = "+1BA7F09AB6B6A9e642"; 06474 str >> CXSC_Pid4[8]; 06475 str = "-1EDD0DBD2544CFe60A"; 06476 str >> CXSC_Pid4[9]; 06477 str = "+179FB1BD1310BAe5D3"; 06478 str >> CXSC_Pid4[10]; 06479 str = "+1A637ED6B0BFF6e59D"; 06480 str >> CXSC_Pid4[11]; 06481 str = "-1A485FCA40908Ee566"; 06482 str >> CXSC_Pid4[12]; 06483 str = "-1E501295D98169e52F"; 06484 str >> CXSC_Pid4[13]; 06485 str = "-1160DBEE83B4E0e4F9"; 06486 str >> CXSC_Pid4[14]; 06487 str = "-19B6D799AE131Ce4C1"; 06488 str >> CXSC_Pid4[15]; 06489 str = "+16CF70801F2E28e48B"; 06490 str >> CXSC_Pid4[16]; 06491 str = "+163BF0598DA483e455"; 06492 str >> CXSC_Pid4[17]; 06493 str = "+1871574E69A459e41F"; 06494 str >> CXSC_Pid4[18]; 06495 str = "-15C0B6CC281F27e3E3"; 06496 str >> CXSC_Pid4[19]; 06497 str = "+15D23DCA3AD962e3AD"; 06498 str >> CXSC_Pid4[20]; 06499 str = "-1CE8654EFBD56Ae376"; 06500 str >> CXSC_Pid4[21]; 06501 str = "-1184AB5BE23DA6e33F"; 06502 str >> CXSC_Pid4[22]; 06503 str = "+166D670C354E4Be309"; 06504 str >> CXSC_Pid4[23]; 06505 str = "-10D9FEC3A2E4FEe2D3"; 06506 str >> CXSC_Pid4[24]; 06507 str = "+1943042F86520Ce29C"; 06508 str >> CXSC_Pid4[25]; 06509 str = "-1B9D1C931C41C6e265"; 06510 str >> CXSC_Pid4[26]; 06511 str = "-188D3E7F179FC6e22D"; 06512 str >> CXSC_Pid4[27]; 06513 str = "-1361F1744FE176e1F7"; 06514 str >> CXSC_Pid4[28]; 06515 str = "+1F6B8ABBE0DE99e1C0"; 06516 str >> CXSC_Pid4[29]; 06517 str = "-169B10EA1A04B5e18A"; 06518 str >> CXSC_Pid4[30]; 06519 str = "-14FD1CF8CD56D0e154"; 06520 str >> CXSC_Pid4[31]; 06521 str = "-18AB54A8D7516Fe11E"; 06522 str >> CXSC_Pid4[32]; 06523 str = "+186263E8144056e0E7"; 06524 str >> CXSC_Pid4[33]; 06525 str = "-1AE34AEAAA77A5e0B0"; 06526 str >> CXSC_Pid4[34]; 06527 str = "+16998B8682283De07A"; 06528 str >> CXSC_Pid4[35]; 06529 str = "+19D42A90D5EF8Ee042"; 06530 str >> CXSC_Pid4[36]; 06531 str = "+174C9D9F70A08Be00C"; 06532 str >> CXSC_Pid4[37]; 06533 str = "+100000000000DBe000"; 06534 str >> CXSC_Pid4[38]; 06535 str = "+100000000000DCe000"; 06536 str >> CXSC_Pid4[39]; 06537 06538 CXSC_Pid4_initialized = true; 06539 std::cout << RestoreOpt; 06540 } 06541 stagprec = stagmax; 06542 y = adjust(l_interval(0)); 06543 06544 for (int i=0; i<=stagmax; i++) 06545 y[i+1] = CXSC_Pid4[i]; 06546 06547 stagprec = stagsave; 06548 y = adjust(y); 06549 06550 return lx_interval(-1022,y); 06551 } // pi/4 06552 06553 // ************************************************************************* 06554 06555 static real CXSC_Pid2[40]; // CXSC_Pid2[0], ... ,CXSC_Pid2[39] 06556 static bool CXSC_Pid2_initialized = false; 06557 06558 lx_interval Pid2_lx_interval() throw() 06559 // Inclusion of 1/ln(10), Blomquist, 27.11.2008; 06560 { 06561 l_interval y; 06562 int stagsave = stagprec, 06563 stagmax = 39; 06564 if (!CXSC_Pid2_initialized) 06565 { 06566 std::string str; 06567 std::cout << SaveOpt; 06568 std::cout << Hex; 06569 str = "+1921FB54442D18e7FC"; 06570 str >> CXSC_Pid2[0]; 06571 str = "+11A62633145C07e7C6"; 06572 str >> CXSC_Pid2[1]; 06573 str = "-1F1976B7ED8FBCe78E"; 06574 str >> CXSC_Pid2[2]; 06575 str = "+14CF98E804177De758"; 06576 str >> CXSC_Pid2[3]; 06577 str = "+131D89CD9128A5e722"; 06578 str >> CXSC_Pid2[4]; 06579 str = "+10F31C6809BBDFe6E8"; 06580 str >> CXSC_Pid2[5]; 06581 str = "+1519B3CD3A431Be6B1"; 06582 str >> CXSC_Pid2[6]; 06583 str = "+18158536F92F8Ae67A"; 06584 str >> CXSC_Pid2[7]; 06585 str = "+1BA7F09AB6B6A9e642"; 06586 str >> CXSC_Pid2[8]; 06587 str = "-1EDD0DBD2544CFe60A"; 06588 str >> CXSC_Pid2[9]; 06589 str = "+179FB1BD1310BAe5D3"; 06590 str >> CXSC_Pid2[10]; 06591 str = "+1A637ED6B0BFF6e59D"; 06592 str >> CXSC_Pid2[11]; 06593 str = "-1A485FCA40908Ee566"; 06594 str >> CXSC_Pid2[12]; 06595 str = "-1E501295D98169e52F"; 06596 str >> CXSC_Pid2[13]; 06597 str = "-1160DBEE83B4E0e4F9"; 06598 str >> CXSC_Pid2[14]; 06599 str = "-19B6D799AE131Ce4C1"; 06600 str >> CXSC_Pid2[15]; 06601 str = "+16CF70801F2E28e48B"; 06602 str >> CXSC_Pid2[16]; 06603 str = "+163BF0598DA483e455"; 06604 str >> CXSC_Pid2[17]; 06605 str = "+1871574E69A459e41F"; 06606 str >> CXSC_Pid2[18]; 06607 str = "-15C0B6CC281F27e3E3"; 06608 str >> CXSC_Pid2[19]; 06609 str = "+15D23DCA3AD962e3AD"; 06610 str >> CXSC_Pid2[20]; 06611 str = "-1CE8654EFBD56Ae376"; 06612 str >> CXSC_Pid2[21]; 06613 str = "-1184AB5BE23DA6e33F"; 06614 str >> CXSC_Pid2[22]; 06615 str = "+166D670C354E4Be309"; 06616 str >> CXSC_Pid2[23]; 06617 str = "-10D9FEC3A2E4FEe2D3"; 06618 str >> CXSC_Pid2[24]; 06619 str = "+1943042F86520Ce29C"; 06620 str >> CXSC_Pid2[25]; 06621 str = "-1B9D1C931C41C6e265"; 06622 str >> CXSC_Pid2[26]; 06623 str = "-188D3E7F179FC6e22D"; 06624 str >> CXSC_Pid2[27]; 06625 str = "-1361F1744FE176e1F7"; 06626 str >> CXSC_Pid2[28]; 06627 str = "+1F6B8ABBE0DE99e1C0"; 06628 str >> CXSC_Pid2[29]; 06629 str = "-169B10EA1A04B5e18A"; 06630 str >> CXSC_Pid2[30]; 06631 str = "-14FD1CF8CD56D0e154"; 06632 str >> CXSC_Pid2[31]; 06633 str = "-18AB54A8D7516Fe11E"; 06634 str >> CXSC_Pid2[32]; 06635 str = "+186263E8144056e0E7"; 06636 str >> CXSC_Pid2[33]; 06637 str = "-1AE34AEAAA77A5e0B0"; 06638 str >> CXSC_Pid2[34]; 06639 str = "+16998B8682283De07A"; 06640 str >> CXSC_Pid2[35]; 06641 str = "+19D42A90D5EF8Ee042"; 06642 str >> CXSC_Pid2[36]; 06643 str = "+174C9D9F70A08Be00C"; 06644 str >> CXSC_Pid2[37]; 06645 str = "+100000000000DBe000"; 06646 str >> CXSC_Pid2[38]; 06647 str = "+100000000000DCe000"; 06648 str >> CXSC_Pid2[39]; 06649 06650 CXSC_Pid2_initialized = true; 06651 std::cout << RestoreOpt; 06652 } 06653 stagprec = stagmax; 06654 y = adjust(l_interval(0)); 06655 06656 for (int i=0; i<=stagmax; i++) 06657 y[i+1] = CXSC_Pid2[i]; 06658 06659 stagprec = stagsave; 06660 y = adjust(y); 06661 06662 return lx_interval(-1021,y); 06663 } // pi/2 06664 06665 // ************************************************************************** 06666 06667 static real CXSC_Pi2[40]; // CXSC_Pi2[0], ... ,CXSC_Pi2[39] 06668 static bool CXSC_Pi2_initialized = false; 06669 06670 lx_interval Pi2_lx_interval() throw() 06671 // Inclusion of 2*pi, Blomquist, 27.11.2008; 06672 { 06673 l_interval y; 06674 int stagsave = stagprec, 06675 stagmax = 39; // alt 06676 if (!CXSC_Pi2_initialized) 06677 { 06678 std::string str; 06679 std::cout << SaveOpt; 06680 std::cout << Hex; 06681 str = "+1921FB54442D18e7FC"; 06682 str >> CXSC_Pi2[0]; 06683 str = "+11A62633145C07e7C6"; 06684 str >> CXSC_Pi2[1]; 06685 str = "-1F1976B7ED8FBCe78E"; 06686 str >> CXSC_Pi2[2]; 06687 str = "+14CF98E804177De758"; 06688 str >> CXSC_Pi2[3]; 06689 str = "+131D89CD9128A5e722"; 06690 str >> CXSC_Pi2[4]; 06691 str = "+10F31C6809BBDFe6E8"; 06692 str >> CXSC_Pi2[5]; 06693 str = "+1519B3CD3A431Be6B1"; 06694 str >> CXSC_Pi2[6]; 06695 str = "+18158536F92F8Ae67A"; 06696 str >> CXSC_Pi2[7]; 06697 str = "+1BA7F09AB6B6A9e642"; 06698 str >> CXSC_Pi2[8]; 06699 str = "-1EDD0DBD2544CFe60A"; 06700 str >> CXSC_Pi2[9]; 06701 str = "+179FB1BD1310BAe5D3"; 06702 str >> CXSC_Pi2[10]; 06703 str = "+1A637ED6B0BFF6e59D"; 06704 str >> CXSC_Pi2[11]; 06705 str = "-1A485FCA40908Ee566"; 06706 str >> CXSC_Pi2[12]; 06707 str = "-1E501295D98169e52F"; 06708 str >> CXSC_Pi2[13]; 06709 str = "-1160DBEE83B4E0e4F9"; 06710 str >> CXSC_Pi2[14]; 06711 str = "-19B6D799AE131Ce4C1"; 06712 str >> CXSC_Pi2[15]; 06713 str = "+16CF70801F2E28e48B"; 06714 str >> CXSC_Pi2[16]; 06715 str = "+163BF0598DA483e455"; 06716 str >> CXSC_Pi2[17]; 06717 str = "+1871574E69A459e41F"; 06718 str >> CXSC_Pi2[18]; 06719 str = "-15C0B6CC281F27e3E3"; 06720 str >> CXSC_Pi2[19]; 06721 str = "+15D23DCA3AD962e3AD"; 06722 str >> CXSC_Pi2[20]; 06723 str = "-1CE8654EFBD56Ae376"; 06724 str >> CXSC_Pi2[21]; 06725 str = "-1184AB5BE23DA6e33F"; 06726 str >> CXSC_Pi2[22]; 06727 str = "+166D670C354E4Be309"; 06728 str >> CXSC_Pi2[23]; 06729 str = "-10D9FEC3A2E4FEe2D3"; 06730 str >> CXSC_Pi2[24]; 06731 str = "+1943042F86520Ce29C"; 06732 str >> CXSC_Pi2[25]; 06733 str = "-1B9D1C931C41C6e265"; 06734 str >> CXSC_Pi2[26]; 06735 str = "-188D3E7F179FC6e22D"; 06736 str >> CXSC_Pi2[27]; 06737 str = "-1361F1744FE176e1F7"; 06738 str >> CXSC_Pi2[28]; 06739 str = "+1F6B8ABBE0DE99e1C0"; 06740 str >> CXSC_Pi2[29]; 06741 str = "-169B10EA1A04B5e18A"; 06742 str >> CXSC_Pi2[30]; 06743 str = "-14FD1CF8CD56D0e154"; 06744 str >> CXSC_Pi2[31]; 06745 str = "-18AB54A8D7516Fe11E"; 06746 str >> CXSC_Pi2[32]; 06747 str = "+186263E8144056e0E7"; 06748 str >> CXSC_Pi2[33]; 06749 str = "-1AE34AEAAA77A5e0B0"; 06750 str >> CXSC_Pi2[34]; 06751 str = "+16998B8682283De07A"; 06752 str >> CXSC_Pi2[35]; 06753 str = "+19D42A90D5EF8Ee042"; 06754 str >> CXSC_Pi2[36]; 06755 str = "+174C9D9F70A08Be00C"; 06756 str >> CXSC_Pi2[37]; 06757 str = "+100000000000DBe000"; 06758 str >> CXSC_Pi2[38]; 06759 str = "+100000000000DCe000"; 06760 str >> CXSC_Pi2[39]; 06761 06762 CXSC_Pi2_initialized = true; 06763 std::cout << RestoreOpt; 06764 } 06765 stagprec = stagmax; 06766 y = adjust(l_interval(0)); 06767 06768 for (int i=0; i<=stagmax; i++) 06769 y[i+1] = CXSC_Pi2[i]; 06770 06771 stagprec = stagsave; 06772 y = adjust(y); 06773 06774 return lx_interval(-1019,y); 06775 } // 2pi 06776 06777 // ************************************************************************** 06778 06779 static real CXSC_Pi2r[40]; // CXSC_Pi2r[0], ... ,CXSC_Pi2r[39] 06780 static bool CXSC_Pi2r_initialized = false; 06781 06782 lx_interval Pi2r_lx_interval() throw() 06783 // Inclusion of 1/Pi, Blomquist, 15.06.2007; 06784 { 06785 l_interval y; 06786 int stagsave = stagprec, 06787 stagmax = 39; 06788 if (!CXSC_Pi2r_initialized) 06789 { 06790 std::string str; 06791 std::cout << SaveOpt; 06792 std::cout << Hex; 06793 str = "+145F306DC9C883e7FC"; 06794 str >> CXSC_Pi2r[0]; 06795 str = "-16B01EC5417056e7C6"; 06796 str >> CXSC_Pi2r[1]; 06797 str = "-16447E493AD4CEe790"; 06798 str >> CXSC_Pi2r[2]; 06799 str = "+1E21C820FF28B2e75A"; 06800 str >> CXSC_Pi2r[3]; 06801 str = "-1508510EA79237e723"; 06802 str >> CXSC_Pi2r[4]; 06803 str = "+1B8E909374B802e6EB"; 06804 str >> CXSC_Pi2r[5]; 06805 str = "-1B6D115F62E6DEe6B5"; 06806 str >> CXSC_Pi2r[6]; 06807 str = "-180F10A71A76B3e67E"; 06808 str >> CXSC_Pi2r[7]; 06809 str = "+1CFBA208D7D4BBe647"; 06810 str >> CXSC_Pi2r[8]; 06811 str = "-12EDEC598E3F65e60F"; 06812 str >> CXSC_Pi2r[9]; 06813 str = "-1741037D8CDC54e5D8"; 06814 str >> CXSC_Pi2r[10]; 06815 str = "+1CC1A99CFA4E42e5A2"; 06816 str >> CXSC_Pi2r[11]; 06817 str = "+17E2EF7E4A0EC8e56B"; 06818 str >> CXSC_Pi2r[12]; 06819 str = "-1DA00087E99FC0e52F"; 06820 str >> CXSC_Pi2r[13]; 06821 str = "-10D0EE74A5F593e4F9"; 06822 str >> CXSC_Pi2r[14]; 06823 str = "+1F6D367ECF27CBe4C1"; 06824 str >> CXSC_Pi2r[15]; 06825 str = "+136E9E8C7ECD3De488"; 06826 str >> CXSC_Pi2r[16]; 06827 str = "-100AE9456C229Ce452"; 06828 str >> CXSC_Pi2r[17]; 06829 str = "-141A0E84C2F8C6e419"; 06830 str >> CXSC_Pi2r[18]; 06831 str = "-10EB5ADA2B2809e3E0"; 06832 str >> CXSC_Pi2r[19]; 06833 str = "-10277039517BD5e3AA"; 06834 str >> CXSC_Pi2r[20]; 06835 str = "+198237E3DB5D60e36E"; 06836 str >> CXSC_Pi2r[21]; 06837 str = "-1E6087BECA1794e338"; 06838 str >> CXSC_Pi2r[22]; 06839 str = "+1DA9E391615EE6e301"; 06840 str >> CXSC_Pi2r[23]; 06841 str = "+1B086599855F15e2C9"; 06842 str >> CXSC_Pi2r[24]; 06843 str = "-17E5EFDC8009E0e293"; 06844 str >> CXSC_Pi2r[25]; 06845 str = "+135CC9CC418185e25B"; 06846 str >> CXSC_Pi2r[26]; 06847 str = "+156CA73A8C960Ee225"; 06848 str >> CXSC_Pi2r[27]; 06849 str = "+13DE04635A3E21e1EE"; 06850 str >> CXSC_Pi2r[28]; 06851 str = "-18F260C88C5FDBe1B7"; 06852 str >> CXSC_Pi2r[29]; 06853 str = "-157CA63B89746Ae181"; 06854 str >> CXSC_Pi2r[30]; 06855 str = "+1CA6DDAF44D157e149"; 06856 str >> CXSC_Pi2r[31]; 06857 str = "+19053EA5FF0705e111"; 06858 str >> CXSC_Pi2r[32]; 06859 str = "+1FBF19F419616Fe0DA"; 06860 str >> CXSC_Pi2r[33]; 06861 str = "+13E60C9F6EF0CFe0A3"; 06862 str >> CXSC_Pi2r[34]; 06863 str = "+126EF6B1E5EF8Ae06D"; 06864 str >> CXSC_Pi2r[35]; 06865 str = "-18BC1946A1B01Ce034"; 06866 str >> CXSC_Pi2r[36]; 06867 str = "-12780EDE6F8384e000"; 06868 str >> CXSC_Pi2r[37]; 06869 str = "+10000000000000e000"; 06870 str >> CXSC_Pi2r[38]; 06871 str = "+10000000000001e000"; 06872 str >> CXSC_Pi2r[39]; 06873 06874 CXSC_Pi2r_initialized = true; 06875 std::cout << RestoreOpt; 06876 } 06877 stagprec = stagmax; 06878 y = adjust(l_interval(0)); 06879 06880 for (int i=0; i<=stagmax; i++) 06881 y[i+1] = CXSC_Pi2r[i]; 06882 06883 stagprec = stagsave; 06884 y = adjust(y); 06885 06886 return lx_interval(-1024,y); 06887 } // 1/(2*pi) 06888 06889 // ************************************************************************** 06890 06891 static real CXSC_Pip2[40]; // CXSC_Pip2[0], ... ,CXSC_Pip2[39] 06892 static bool CXSC_Pip2_initialized = false; 06893 06894 lx_interval Pip2_lx_interval() throw() 06895 // Inclusion of 1/Pi, Blomquist, 15.06.2007; 06896 { 06897 l_interval y; 06898 int stagsave = stagprec, 06899 stagmax = 39; 06900 if (!CXSC_Pip2_initialized) 06901 { 06902 std::string str; 06903 std::cout << SaveOpt; 06904 std::cout << Hex; 06905 str = "+13BD3CC9BE45DEe7FD"; 06906 str >> CXSC_Pip2[0]; 06907 str = "+1692B71366CC04e7C7"; 06908 str >> CXSC_Pip2[1]; 06909 str = "+18358E10ACD480e791"; 06910 str >> CXSC_Pip2[2]; 06911 str = "-1F2F5DD7997DDFe75A"; 06912 str >> CXSC_Pip2[3]; 06913 str = "+129E39B47B884Ee71F"; 06914 str >> CXSC_Pip2[4]; 06915 str = "-12CF7459DD5DAFe6E9"; 06916 str >> CXSC_Pip2[5]; 06917 str = "-11842F87B5FE0Fe6B3"; 06918 str >> CXSC_Pip2[6]; 06919 str = "+1FFD8A79616A21e67D"; 06920 str >> CXSC_Pip2[7]; 06921 str = "+12492A6663E899e647"; 06922 str >> CXSC_Pip2[8]; 06923 str = "-1A15F4352CC511e610"; 06924 str >> CXSC_Pip2[9]; 06925 str = "-1301AA1792FF3Ce5D9"; 06926 str >> CXSC_Pip2[10]; 06927 str = "+122B6F31626EFEe5A3"; 06928 str >> CXSC_Pip2[11]; 06929 str = "+1B317FA13BDD8Fe56D"; 06930 str >> CXSC_Pip2[12]; 06931 str = "+16F83B49040075e537"; 06932 str >> CXSC_Pip2[13]; 06933 str = "-1B1890A945FE17e501"; 06934 str >> CXSC_Pip2[14]; 06935 str = "+12DCD389B96CDBe4CB"; 06936 str >> CXSC_Pip2[15]; 06937 str = "-1743F5DDE2F157e492"; 06938 str >> CXSC_Pip2[16]; 06939 str = "-153F96FFD4AEB5e45B"; 06940 str >> CXSC_Pip2[17]; 06941 str = "+13CD6F5847D569e423"; 06942 str >> CXSC_Pip2[18]; 06943 str = "+1471E79A7B0882e3EC"; 06944 str >> CXSC_Pip2[19]; 06945 str = "-14C5022456E37Ae3B6"; 06946 str >> CXSC_Pip2[20]; 06947 str = "-1471463BD938A3e380"; 06948 str >> CXSC_Pip2[21]; 06949 str = "+13EABA147FEB41e349"; 06950 str >> CXSC_Pip2[22]; 06951 str = "-1D7FBCA9B23073e312"; 06952 str >> CXSC_Pip2[23]; 06953 str = "-17B06B8196DD15e2DC"; 06954 str >> CXSC_Pip2[24]; 06955 str = "-13A91786954EA1e2A6"; 06956 str >> CXSC_Pip2[25]; 06957 str = "+1C841C914201E8e26F"; 06958 str >> CXSC_Pip2[26]; 06959 str = "-1BDD5D6465807De239"; 06960 str >> CXSC_Pip2[27]; 06961 str = "-1BD8C694B35945e202"; 06962 str >> CXSC_Pip2[28]; 06963 str = "+181914426DA9A7e1CC"; 06964 str >> CXSC_Pip2[29]; 06965 str = "-1C83BE2430C1FEe192"; 06966 str >> CXSC_Pip2[30]; 06967 str = "+16530E2CE920C0e157"; 06968 str >> CXSC_Pip2[31]; 06969 str = "+103B8F2850B82Ee121"; 06970 str >> CXSC_Pip2[32]; 06971 str = "-1F116B01D43595e0EB"; 06972 str >> CXSC_Pip2[33]; 06973 str = "-13AF6BD210759Fe0B5"; 06974 str >> CXSC_Pip2[34]; 06975 str = "+1F82CDE6A1FFF3e07E"; 06976 str >> CXSC_Pip2[35]; 06977 str = "+1C8EF198F1ACD2e048"; 06978 str >> CXSC_Pip2[36]; 06979 str = "+18077590C18251e011"; 06980 str >> CXSC_Pip2[37]; 06981 str = "-10000000002C7Ee000"; 06982 str >> CXSC_Pip2[38]; 06983 str = "-10000000002C7De000"; 06984 str >> CXSC_Pip2[39]; 06985 06986 CXSC_Pip2_initialized = true; 06987 std::cout << RestoreOpt; 06988 } 06989 stagprec = stagmax; 06990 y = adjust(l_interval(0)); 06991 06992 for (int i=0; i<=stagmax; i++) 06993 y[i+1] = CXSC_Pip2[i]; 06994 06995 stagprec = stagsave; 06996 y = adjust(y); 06997 06998 return lx_interval(-1019,y); 06999 } // pi^2 07000 07001 // ************************************************************************** 07002 07003 static real CXSC_Sqrt2r[40]; // CXSC_Sqrt2r[0], ... ,CXSC_Sqrt2r[39] 07004 static bool CXSC_Sqrt2r_initialized = false; 07005 07006 lx_interval Sqrt2r_lx_interval() throw() 07007 // Inclusion of sqrt(2), Blomquist, 27.11.2008; 07008 { 07009 l_interval y; 07010 int stagsave = stagprec, 07011 stagmax = 39; 07012 if (!CXSC_Sqrt2r_initialized) 07013 { 07014 std::string str; 07015 std::cout << SaveOpt; 07016 std::cout << Hex; 07017 str = "+16A09E667F3BCDe7FC"; 07018 str >> CXSC_Sqrt2r[0]; 07019 str = "-1BDD3413B26456e7C6"; 07020 str >> CXSC_Sqrt2r[1]; 07021 str = "+157D3E3ADEC175e790"; 07022 str >> CXSC_Sqrt2r[2]; 07023 str = "+12775099DA2F59e758"; 07024 str >> CXSC_Sqrt2r[3]; 07025 str = "+160CCE64552BF2e71F"; 07026 str >> CXSC_Sqrt2r[4]; 07027 str = "+1821D5C5161D46e6E6"; 07028 str >> CXSC_Sqrt2r[5]; 07029 str = "-1C032046F8498Ee6B0"; 07030 str >> CXSC_Sqrt2r[6]; 07031 str = "+1EE950BC8738F7e678"; 07032 str >> CXSC_Sqrt2r[7]; 07033 str = "-1AC3FDBC64E103e642"; 07034 str >> CXSC_Sqrt2r[8]; 07035 str = "+13B469101743A1e60A"; 07036 str >> CXSC_Sqrt2r[9]; 07037 str = "+15E3E9CA60B38Ce5D4"; 07038 str >> CXSC_Sqrt2r[10]; 07039 str = "+11BC337BCAB1BDe599"; 07040 str >> CXSC_Sqrt2r[11]; 07041 str = "-1BBA5DEE9D6E7De563"; 07042 str >> CXSC_Sqrt2r[12]; 07043 str = "-1438DD083B1CC4e52D"; 07044 str >> CXSC_Sqrt2r[13]; 07045 str = "+1B56A28E2EDFA7e4F7"; 07046 str >> CXSC_Sqrt2r[14]; 07047 str = "+1CCB2A634331F4e4C1"; 07048 str >> CXSC_Sqrt2r[15]; 07049 str = "-1BD9056876F83Ee48A"; 07050 str >> CXSC_Sqrt2r[16]; 07051 str = "-1234FA22AB6BEFe454"; 07052 str >> CXSC_Sqrt2r[17]; 07053 str = "+19040CA4A81395e41D"; 07054 str >> CXSC_Sqrt2r[18]; 07055 str = "-15249C0BC4082De3E7"; 07056 str >> CXSC_Sqrt2r[19]; 07057 str = "+13A02CEBC93E0Ce3B1"; 07058 str >> CXSC_Sqrt2r[20]; 07059 str = "+109936AF354A2Ee37B"; 07060 str >> CXSC_Sqrt2r[21]; 07061 str = "-1AE4730CBE4908e345"; 07062 str >> CXSC_Sqrt2r[22]; 07063 str = "+11B6380826E010e30E"; 07064 str >> CXSC_Sqrt2r[23]; 07065 str = "-1CDCAD0CCD5A16e2D5"; 07066 str >> CXSC_Sqrt2r[24]; 07067 str = "-1084BC28012BC8e29C"; 07068 str >> CXSC_Sqrt2r[25]; 07069 str = "-1C035DDECF8216e265"; 07070 str >> CXSC_Sqrt2r[26]; 07071 str = "+18907DEAA070B0e22B"; 07072 str >> CXSC_Sqrt2r[27]; 07073 str = "+1FCBDDEA2F7DC3e1F5"; 07074 str >> CXSC_Sqrt2r[28]; 07075 str = "+18C41C51757FB0e1BE"; 07076 str >> CXSC_Sqrt2r[29]; 07077 str = "-189A5B616B1381e188"; 07078 str >> CXSC_Sqrt2r[30]; 07079 str = "+165C417EFF0B88e152"; 07080 str >> CXSC_Sqrt2r[31]; 07081 str = "-1627043F832999e11A"; 07082 str >> CXSC_Sqrt2r[32]; 07083 str = "+105E5FCA017092e0E3"; 07084 str >> CXSC_Sqrt2r[33]; 07085 str = "-187A16D6A8FDCAe0AD"; 07086 str >> CXSC_Sqrt2r[34]; 07087 str = "-1838421AE0AE62e072"; 07088 str >> CXSC_Sqrt2r[35]; 07089 str = "-165073EB433984e03C"; 07090 str >> CXSC_Sqrt2r[36]; 07091 str = "+1F0A42F9DA4A6Ce006"; 07092 str >> CXSC_Sqrt2r[37]; 07093 str = "+10000000000002e000"; 07094 str >> CXSC_Sqrt2r[38]; 07095 str = "+10000000000003e000"; 07096 str >> CXSC_Sqrt2r[39]; 07097 07098 CXSC_Sqrt2r_initialized = true; 07099 std::cout << RestoreOpt; 07100 } 07101 stagprec = stagmax; 07102 y = adjust(l_interval(0)); 07103 07104 for (int i=0; i<=stagmax; i++) 07105 y[i+1] = CXSC_Sqrt2r[i]; 07106 07107 stagprec = stagsave; 07108 y = adjust(y); 07109 07110 return lx_interval(-1022,y); 07111 } // 1/sqrt(2) 07112 07113 // ************************************************************************ 07114 07115 static real CXSC_Sqrt3d2[40]; // CXSC_Sqrt3d2[0], ... ,CXSC_Sqrt3d2[39] 07116 static bool CXSC_Sqrt3d2_initialized = false; 07117 07118 lx_interval Sqrt3d2_lx_interval() throw() 07119 // Inclusion of sqrt(3), Blomquist, 15.06.2007; 07120 { 07121 l_interval y; 07122 int stagsave = stagprec, 07123 stagmax = 39; 07124 if (!CXSC_Sqrt3d2_initialized) 07125 { 07126 std::string str; 07127 std::cout << SaveOpt; 07128 std::cout << Hex; 07129 str = "+1BB67AE8584CAAe7FC"; 07130 str >> CXSC_Sqrt3d2[0]; 07131 str = "+1CEC95D0B5C1E3e7C6"; 07132 str >> CXSC_Sqrt3d2[1]; 07133 str = "-1F11DB689F2CCFe78E"; 07134 str >> CXSC_Sqrt3d2[2]; 07135 str = "+13DA4798C720A6e758"; 07136 str >> CXSC_Sqrt3d2[3]; 07137 str = "+121B9169B89243e722"; 07138 str >> CXSC_Sqrt3d2[4]; 07139 str = "-1813508751212Be6E9"; 07140 str >> CXSC_Sqrt3d2[5]; 07141 str = "-1B3D547B775C1Ee6B2"; 07142 str >> CXSC_Sqrt3d2[6]; 07143 str = "-19D986D92E2F0Ae679"; 07144 str >> CXSC_Sqrt3d2[7]; 07145 str = "+1A34334CE806B6e642"; 07146 str >> CXSC_Sqrt3d2[8]; 07147 str = "+1A383B9E122E61e60C"; 07148 str >> CXSC_Sqrt3d2[9]; 07149 str = "+1C61D736F2F6F2e5D5"; 07150 str >> CXSC_Sqrt3d2[10]; 07151 str = "-10AF49233F9250e59E"; 07152 str >> CXSC_Sqrt3d2[11]; 07153 str = "-1558A109EC0523e567"; 07154 str >> CXSC_Sqrt3d2[12]; 07155 str = "+1F799D4D4FF2BCe531"; 07156 str >> CXSC_Sqrt3d2[13]; 07157 str = "-1AD7B219E34EDBe4FB"; 07158 str >> CXSC_Sqrt3d2[14]; 07159 str = "+15AB940B6677E3e4C5"; 07160 str >> CXSC_Sqrt3d2[15]; 07161 str = "-1D9B2A8203B8F0e48E"; 07162 str >> CXSC_Sqrt3d2[16]; 07163 str = "-1DB0C8975A3834e458"; 07164 str >> CXSC_Sqrt3d2[17]; 07165 str = "-1BCAAB3F6BE884e422"; 07166 str >> CXSC_Sqrt3d2[18]; 07167 str = "+14C70ADB1EC1BBe3E8"; 07168 str >> CXSC_Sqrt3d2[19]; 07169 str = "-14E1EF77987E55e3AF"; 07170 str >> CXSC_Sqrt3d2[20]; 07171 str = "-19695FC6269D28e378"; 07172 str >> CXSC_Sqrt3d2[21]; 07173 str = "+10D0652AAC5936e342"; 07174 str >> CXSC_Sqrt3d2[22]; 07175 str = "-1BD0891D370824e30C"; 07176 str >> CXSC_Sqrt3d2[23]; 07177 str = "-129B4C6252D061e2D4"; 07178 str >> CXSC_Sqrt3d2[24]; 07179 str = "+1DC9B1A4C31275e29E"; 07180 str >> CXSC_Sqrt3d2[25]; 07181 str = "+11FF9B8422294Ee267"; 07182 str >> CXSC_Sqrt3d2[26]; 07183 str = "-1E4A6AA47F3A85e231"; 07184 str >> CXSC_Sqrt3d2[27]; 07185 str = "+17043E01AA3F3De1FA"; 07186 str >> CXSC_Sqrt3d2[28]; 07187 str = "+188EF377D2D5B6e1C0"; 07188 str >> CXSC_Sqrt3d2[29]; 07189 str = "-1735E8C815F031e185"; 07190 str >> CXSC_Sqrt3d2[30]; 07191 str = "-1B89330FD8417Ce14F"; 07192 str >> CXSC_Sqrt3d2[31]; 07193 str = "+16D1A627670F5Ce117"; 07194 str >> CXSC_Sqrt3d2[32]; 07195 str = "+1AF43BBA8154D3e0DB"; 07196 str >> CXSC_Sqrt3d2[33]; 07197 str = "+1DA9A969A91295e0A5"; 07198 str >> CXSC_Sqrt3d2[34]; 07199 str = "-1636594394C675e06E"; 07200 str >> CXSC_Sqrt3d2[35]; 07201 str = "+1064B9DA1A3185e037"; 07202 str >> CXSC_Sqrt3d2[36]; 07203 str = "-1CE514CF1825CCe001"; 07204 str >> CXSC_Sqrt3d2[37]; 07205 str = "+10000000000000e000"; 07206 str >> CXSC_Sqrt3d2[38]; 07207 str = "+10000000000001e000"; 07208 str >> CXSC_Sqrt3d2[39]; 07209 07210 CXSC_Sqrt3d2_initialized = true; 07211 std::cout << RestoreOpt; 07212 } 07213 stagprec = stagmax; 07214 y = adjust(l_interval(0)); 07215 07216 for (int i=0; i<=stagmax; i++) 07217 y[i+1] = CXSC_Sqrt3d2[i]; 07218 07219 stagprec = stagsave; 07220 y = adjust(y); 07221 07222 return lx_interval(-1022,y); 07223 } // sqrt(3)/2 07224 07225 // ********************************************************************** 07226 07227 static real CXSC_Sqrt3r[40]; // CXSC_Sqrt3r[0], ... ,CXSC_Sqrt3r[39] 07228 static bool CXSC_Sqrt3r_initialized = false; 07229 07230 lx_interval Sqrt3r_lx_interval() throw() 07231 // Inclusion of 1/sqrt(3), Blomquist, 27.11.2008; 07232 { 07233 l_interval y; 07234 int stagsave = stagprec, 07235 stagmax = 39; 07236 if (!CXSC_Sqrt3r_initialized) 07237 { 07238 std::string str; 07239 std::cout << SaveOpt; 07240 std::cout << Hex; 07241 str = "+1279A74590331Ce7FC"; 07242 str >> CXSC_Sqrt3r[0]; 07243 str = "+134863E0792BEDe7C6"; 07244 str >> CXSC_Sqrt3r[1]; 07245 str = "-1A82F9E6C53222e790"; 07246 str >> CXSC_Sqrt3r[2]; 07247 str = "-1CB0F41134253Ae75A"; 07248 str >> CXSC_Sqrt3r[3]; 07249 str = "+1859ED919EC30Be724"; 07250 str >> CXSC_Sqrt3r[4]; 07251 str = "+1454874FB1F3F4e6ED"; 07252 str >> CXSC_Sqrt3r[5]; 07253 str = "-1DE69C6D3D2741e6B7"; 07254 str >> CXSC_Sqrt3r[6]; 07255 str = "+17EEC450C48BE1e681"; 07256 str >> CXSC_Sqrt3r[7]; 07257 str = "-16F743EEE65D53e64B"; 07258 str >> CXSC_Sqrt3r[8]; 07259 str = "-1887B505D7E7C2e613"; 07260 str >> CXSC_Sqrt3r[9]; 07261 str = "-1484D2E10C1161e5DC"; 07262 str >> CXSC_Sqrt3r[10]; 07263 str = "-1A0B1F86177FB7e5A6"; 07264 str >> CXSC_Sqrt3r[11]; 07265 str = "+1FE389D3F2C54Ee56E"; 07266 str >> CXSC_Sqrt3r[12]; 07267 str = "+1F29F77C671544e538"; 07268 str >> CXSC_Sqrt3r[13]; 07269 str = "-16CE74ED77D9BEe502"; 07270 str >> CXSC_Sqrt3r[14]; 07271 str = "-1E38708FF0CCB5e4CC"; 07272 str >> CXSC_Sqrt3r[15]; 07273 str = "-1F13BCC70157D1e496"; 07274 str >> CXSC_Sqrt3r[16]; 07275 str = "+17EC34CF9B1930e460"; 07276 str >> CXSC_Sqrt3r[17]; 07277 str = "-117A638EFF3A8Be429"; 07278 str >> CXSC_Sqrt3r[18]; 07279 str = "-16A8EF69C312C5e3F3"; 07280 str >> CXSC_Sqrt3r[19]; 07281 str = "-1835C4B4FD2883e3BC"; 07282 str >> CXSC_Sqrt3r[20]; 07283 str = "+178E66E7009A44e386"; 07284 str >> CXSC_Sqrt3r[21]; 07285 str = "-136FD3299CE38Ae350"; 07286 str >> CXSC_Sqrt3r[22]; 07287 str = "+10CE607E925CC3e31A"; 07288 str >> CXSC_Sqrt3r[23]; 07289 str = "-1AC2B71232EC37e2E4"; 07290 str >> CXSC_Sqrt3r[24]; 07291 str = "-1ACAD8486879A7e2AD"; 07292 str >> CXSC_Sqrt3r[25]; 07293 str = "+1B7C6155125817e277"; 07294 str >> CXSC_Sqrt3r[26]; 07295 str = "-1CE6286338DB54e240"; 07296 str >> CXSC_Sqrt3r[27]; 07297 str = "-13819B52815439e20A"; 07298 str >> CXSC_Sqrt3r[28]; 07299 str = "-159653496BB604e1D3"; 07300 str >> CXSC_Sqrt3r[29]; 07301 str = "+1E3CEA8BB81EF5e19C"; 07302 str >> CXSC_Sqrt3r[30]; 07303 str = "+1C0A89B6922280e165"; 07304 str >> CXSC_Sqrt3r[31]; 07305 str = "+1A7F02B9E11970e12F"; 07306 str >> CXSC_Sqrt3r[32]; 07307 str = "-197D70AA62CA0Be0F9"; 07308 str >> CXSC_Sqrt3r[33]; 07309 str = "-18FF1CC85B90E7e0C3"; 07310 str >> CXSC_Sqrt3r[34]; 07311 str = "+19C2DC378988CFe08B"; 07312 str >> CXSC_Sqrt3r[35]; 07313 str = "-1A1BB3467EF366e055"; 07314 str >> CXSC_Sqrt3r[36]; 07315 str = "+1166CBADB2F273e01F"; 07316 str >> CXSC_Sqrt3r[37]; 07317 str = "+1000000B453C22e000"; 07318 str >> CXSC_Sqrt3r[38]; 07319 str = "+1000000B453C23e000"; 07320 str >> CXSC_Sqrt3r[39]; 07321 07322 CXSC_Sqrt3r_initialized = true; 07323 std::cout << RestoreOpt; 07324 } 07325 stagprec = stagmax; 07326 y = adjust(l_interval(0)); 07327 07328 for (int i=0; i<=stagmax; i++) 07329 y[i+1] = CXSC_Sqrt3r[i]; 07330 07331 stagprec = stagsave; 07332 y = adjust(y); 07333 07334 return lx_interval(-1022,y); 07335 } // 1/sqrt(3) 07336 07337 // ********************************************************************** 07338 07339 static real CXSC_Er[40]; // CXSC_Er[0], ... ,CXSC_Er[39] 07340 static bool CXSC_Er_initialized = false; 07341 07342 lx_interval Er_lx_interval() throw() 07343 // Inclusion of 1/sqrt(3), Blomquist, 27.11.2008; 07344 { 07345 l_interval y; 07346 int stagsave = stagprec, 07347 stagmax = 39; 07348 if (!CXSC_Er_initialized) 07349 { 07350 std::string str; 07351 std::cout << SaveOpt; 07352 std::cout << Hex; 07353 str = "+178B56362CEF38e7FC"; 07354 str >> CXSC_Er[0]; 07355 str = "-1CA8A4270FADF5e7C5"; 07356 str >> CXSC_Er[1]; 07357 str = "-1837912B3FD2AAe78F"; 07358 str >> CXSC_Er[2]; 07359 str = "-152711999FB68Ce759"; 07360 str >> CXSC_Er[3]; 07361 str = "-17AD7C1289274Ee723"; 07362 str >> CXSC_Er[4]; 07363 str = "+17E8E56842B705e6E5"; 07364 str >> CXSC_Er[5]; 07365 str = "-1D24CB13796C2De6AF"; 07366 str >> CXSC_Er[6]; 07367 str = "-1456AABDA5C8F2e678"; 07368 str >> CXSC_Er[7]; 07369 str = "+1229F03C6276DDe642"; 07370 str >> CXSC_Er[8]; 07371 str = "-1569CFC4F53109e60C"; 07372 str >> CXSC_Er[9]; 07373 str = "-155B63C9B68091e5D4"; 07374 str >> CXSC_Er[10]; 07375 str = "+1580CF14DC087Ce59E"; 07376 str >> CXSC_Er[11]; 07377 str = "+1F9FF222313669e567"; 07378 str >> CXSC_Er[12]; 07379 str = "+15BC9CB1A22487e531"; 07380 str >> CXSC_Er[13]; 07381 str = "-1857E415C89B13e4FA"; 07382 str >> CXSC_Er[14]; 07383 str = "+13DF75706E3643e4C4"; 07384 str >> CXSC_Er[15]; 07385 str = "+13BDF5B7646234e48C"; 07386 str >> CXSC_Er[16]; 07387 str = "+1C956A5A3BE55De456"; 07388 str >> CXSC_Er[17]; 07389 str = "-167243FE9CD95Ee41F"; 07390 str >> CXSC_Er[18]; 07391 str = "+1798666D9D76F9e3E9"; 07392 str >> CXSC_Er[19]; 07393 str = "-195BC96299ED95e3B3"; 07394 str >> CXSC_Er[20]; 07395 str = "-1962287D82F280e37D"; 07396 str >> CXSC_Er[21]; 07397 str = "+1C3CF6DDC027D8e347"; 07398 str >> CXSC_Er[22]; 07399 str = "-182A3C09F5C0B7e310"; 07400 str >> CXSC_Er[23]; 07401 str = "+181C26FE7F6AB1e2DA"; 07402 str >> CXSC_Er[24]; 07403 str = "+19F6D7E4825294e2A4"; 07404 str >> CXSC_Er[25]; 07405 str = "+1BBC423BEA892Fe26D"; 07406 str >> CXSC_Er[26]; 07407 str = "+1342C7A3A14AB4e237"; 07408 str >> CXSC_Er[27]; 07409 str = "+12A70DFB042173e201"; 07410 str >> CXSC_Er[28]; 07411 str = "-10325653502352e1CB"; 07412 str >> CXSC_Er[29]; 07413 str = "-10AD4492DE41FFe191"; 07414 str >> CXSC_Er[30]; 07415 str = "-1E4529AB93CDA1e156"; 07416 str >> CXSC_Er[31]; 07417 str = "+1128833F39DF0Ae11E"; 07418 str >> CXSC_Er[32]; 07419 str = "-1E7EDF8F9B8A50e0E8"; 07420 str >> CXSC_Er[33]; 07421 str = "+1A42CBDB5BB8D0e0B0"; 07422 str >> CXSC_Er[34]; 07423 str = "+1973F3BD8250A1e07A"; 07424 str >> CXSC_Er[35]; 07425 str = "+116AF9EF0E6C71e040"; 07426 str >> CXSC_Er[36]; 07427 str = "-1786993285AA7Ae00A"; 07428 str >> CXSC_Er[37]; 07429 str = "-1000000000007De000"; 07430 str >> CXSC_Er[38]; 07431 str = "-1000000000007Ce000"; 07432 str >> CXSC_Er[39]; 07433 07434 CXSC_Er_initialized = true; 07435 std::cout << RestoreOpt; 07436 } 07437 stagprec = stagmax; 07438 y = adjust(l_interval(0)); 07439 07440 for (int i=0; i<=stagmax; i++) 07441 y[i+1] = CXSC_Er[i]; 07442 07443 stagprec = stagsave; 07444 y = adjust(y); 07445 07446 return lx_interval(-1023,y); 07447 } // 1/e 07448 07449 // ********************************************************************** 07450 07451 static real CXSC_Ep2[40]; // CXSC_Ep2[0], ... ,CXSC_Ep2[39] 07452 static bool CXSC_Ep2_initialized = false; 07453 07454 lx_interval Ep2_lx_interval() throw() 07455 // Inclusion of e^2, Blomquist, 27.11.2008; 07456 { 07457 l_interval y; 07458 int stagsave = stagprec, 07459 stagmax = 39; 07460 if (!CXSC_Ep2_initialized) 07461 { 07462 std::string str; 07463 std::cout << SaveOpt; 07464 std::cout << Hex; 07465 str = "+1D8E64B8D4DDAEe7FC"; 07466 str >> CXSC_Ep2[0]; 07467 str = "-19E62E22EFCA4Ce7C5"; 07468 str >> CXSC_Ep2[1]; 07469 str = "+1577508F5CF5EDe78F"; 07470 str >> CXSC_Ep2[2]; 07471 str = "-186EF0294C2511e759"; 07472 str >> CXSC_Ep2[3]; 07473 str = "+177D109F148782e722"; 07474 str >> CXSC_Ep2[4]; 07475 str = "+166BBC354AB700e6EB"; 07476 str >> CXSC_Ep2[5]; 07477 str = "-1273AEC0115969e6B5"; 07478 str >> CXSC_Ep2[6]; 07479 str = "-1C5AE00D3BEEF1e67F"; 07480 str >> CXSC_Ep2[7]; 07481 str = "+15ACA3FDC9595Fe647"; 07482 str >> CXSC_Ep2[8]; 07483 str = "-113FCDFE2B1F0Ce610"; 07484 str >> CXSC_Ep2[9]; 07485 str = "+10EEDFD1AE90C9e5DA"; 07486 str >> CXSC_Ep2[10]; 07487 str = "+1D2CB8EDC7078Be5A4"; 07488 str >> CXSC_Ep2[11]; 07489 str = "+11827A19F175F8e56E"; 07490 str >> CXSC_Ep2[12]; 07491 str = "-10267512A9BFB2e537"; 07492 str >> CXSC_Ep2[13]; 07493 str = "-19A1E2FC413AE3e500"; 07494 str >> CXSC_Ep2[14]; 07495 str = "+1170C7A5981ADBe4CA"; 07496 str >> CXSC_Ep2[15]; 07497 str = "-1FC991480067CFe494"; 07498 str >> CXSC_Ep2[16]; 07499 str = "-12E9A54CF5CFB5e45D"; 07500 str >> CXSC_Ep2[17]; 07501 str = "-166FA6C468910Ae425"; 07502 str >> CXSC_Ep2[18]; 07503 str = "+10FA9B7050AF8De3EE"; 07504 str >> CXSC_Ep2[19]; 07505 str = "+198127CED41761e3B7"; 07506 str >> CXSC_Ep2[20]; 07507 str = "+107FD1EB487B65e380"; 07508 str >> CXSC_Ep2[21]; 07509 str = "+1B63EE064187DBe348"; 07510 str >> CXSC_Ep2[22]; 07511 str = "+13C943324AF1B5e311"; 07512 str >> CXSC_Ep2[23]; 07513 str = "+16AAE6F376094Ee2DA"; 07514 str >> CXSC_Ep2[24]; 07515 str = "+15DBB3D45B5A29e2A4"; 07516 str >> CXSC_Ep2[25]; 07517 str = "-181BC5BF587296e26E"; 07518 str >> CXSC_Ep2[26]; 07519 str = "-1819FC0B42A502e235"; 07520 str >> CXSC_Ep2[27]; 07521 str = "-1E06AE15A2D879e1FF"; 07522 str >> CXSC_Ep2[28]; 07523 str = "+171395ABE3E6CEe1C8"; 07524 str >> CXSC_Ep2[29]; 07525 str = "-1B76514AE69513e192"; 07526 str >> CXSC_Ep2[30]; 07527 str = "-1707F6C56433B7e15C"; 07528 str >> CXSC_Ep2[31]; 07529 str = "+108C1FADE66FE9e126"; 07530 str >> CXSC_Ep2[32]; 07531 str = "+1FB253285CC9E2e0F0"; 07532 str >> CXSC_Ep2[33]; 07533 str = "-16B3E49A6C1691e0B9"; 07534 str >> CXSC_Ep2[34]; 07535 str = "-12B135E875C44Ae080"; 07536 str >> CXSC_Ep2[35]; 07537 str = "+1385B11510C48Ce04A"; 07538 str >> CXSC_Ep2[36]; 07539 str = "-184E63EB2E35F1e010"; 07540 str >> CXSC_Ep2[37]; 07541 str = "+1000000000063Ee000"; 07542 str >> CXSC_Ep2[38]; 07543 str = "+1000000000064Ee000"; 07544 str >> CXSC_Ep2[39]; 07545 07546 CXSC_Ep2_initialized = true; 07547 std::cout << RestoreOpt; 07548 } 07549 stagprec = stagmax; 07550 y = adjust(l_interval(0)); 07551 07552 for (int i=0; i<=stagmax; i++) 07553 y[i+1] = CXSC_Ep2[i]; 07554 07555 stagprec = stagsave; 07556 y = adjust(y); 07557 07558 return lx_interval(-1019,y); 07559 } // e^2 07560 07561 // ********************************************************************** 07562 07563 static real CXSC_Ep2r[40]; // CXSC_Ep2r[0], ... ,CXSC_Ep2r[39] 07564 static bool CXSC_Ep2r_initialized = false; 07565 07566 lx_interval Ep2r_lx_interval() throw() 07567 // Inclusion of 1/e^2, Blomquist, 27.11.2008; 07568 { 07569 l_interval y; 07570 int stagsave = stagprec, 07571 stagmax = 39; 07572 if (!CXSC_Ep2r_initialized) 07573 { 07574 std::string str; 07575 std::cout << SaveOpt; 07576 std::cout << Hex; 07577 str = "+1152AAA3BF81CCe7FD"; 07578 str >> CXSC_Ep2r[0]; 07579 str = "-1809224547B4BFe7C7"; 07580 str >> CXSC_Ep2r[1]; 07581 str = "-16A8E079134F13e791"; 07582 str >> CXSC_Ep2r[2]; 07583 str = "+14564CACF0994Ee759"; 07584 str >> CXSC_Ep2r[3]; 07585 str = "+1B796438129AF8e723"; 07586 str >> CXSC_Ep2r[4]; 07587 str = "-1ACFED57EF2AE5e6ED"; 07588 str >> CXSC_Ep2r[5]; 07589 str = "-1A968CBDBB5D9De6B6"; 07590 str >> CXSC_Ep2r[6]; 07591 str = "+1A7238CBD97B71e67D"; 07592 str >> CXSC_Ep2r[7]; 07593 str = "-146C53DB77BB01e646"; 07594 str >> CXSC_Ep2r[8]; 07595 str = "-1EEC161C3EBBD7e60D"; 07596 str >> CXSC_Ep2r[9]; 07597 str = "-12D084DC157ACEe5D6"; 07598 str >> CXSC_Ep2r[10]; 07599 str = "+12A61F46883347e5A0"; 07600 str >> CXSC_Ep2r[11]; 07601 str = "+1993BAF10CAE0Be565"; 07602 str >> CXSC_Ep2r[12]; 07603 str = "+1F9224351178FFe52F"; 07604 str >> CXSC_Ep2r[13]; 07605 str = "-1C366D1C7BA64Ae4F8"; 07606 str >> CXSC_Ep2r[14]; 07607 str = "-17D9938EFA4657e4C1"; 07608 str >> CXSC_Ep2r[15]; 07609 str = "+1B6668DF0C1286e48B"; 07610 str >> CXSC_Ep2r[16]; 07611 str = "+1F7A4FFC9B48C6e451"; 07612 str >> CXSC_Ep2r[17]; 07613 str = "+1F3E3AF6F17591e41B"; 07614 str >> CXSC_Ep2r[18]; 07615 str = "+1B1E0C69EE87BEe3E4"; 07616 str >> CXSC_Ep2r[19]; 07617 str = "+12DF95CABED5A7e3AD"; 07618 str >> CXSC_Ep2r[20]; 07619 str = "+1665EF8CBE7C05e377"; 07620 str >> CXSC_Ep2r[21]; 07621 str = "-1B3C417ABEAD6Be340"; 07622 str >> CXSC_Ep2r[22]; 07623 str = "-1A19C35B2B0C58e30A"; 07624 str >> CXSC_Ep2r[23]; 07625 str = "+18607193ADB301e2D2"; 07626 str >> CXSC_Ep2r[24]; 07627 str = "-1BB2016A08F428e298"; 07628 str >> CXSC_Ep2r[25]; 07629 str = "+1154B5B7FEDB3Ee262"; 07630 str >> CXSC_Ep2r[26]; 07631 str = "-13AE5C2DBEA451e22C"; 07632 str >> CXSC_Ep2r[27]; 07633 str = "-10F60BC60CDBFCe1F6"; 07634 str >> CXSC_Ep2r[28]; 07635 str = "+1F540F667B3746e1BE"; 07636 str >> CXSC_Ep2r[29]; 07637 str = "-1B205D40167EC7e187"; 07638 str >> CXSC_Ep2r[30]; 07639 str = "+1C8A0A08DE85F9e151"; 07640 str >> CXSC_Ep2r[31]; 07641 str = "+1856ED169F0183e11B"; 07642 str >> CXSC_Ep2r[32]; 07643 str = "-147D787794462Ce0E4"; 07644 str >> CXSC_Ep2r[33]; 07645 str = "+1516AB11B003F3e0AB"; 07646 str >> CXSC_Ep2r[34]; 07647 str = "-1D652A20732EA1e075"; 07648 str >> CXSC_Ep2r[35]; 07649 str = "-12EB9F673FF3EDe03F"; 07650 str >> CXSC_Ep2r[36]; 07651 str = "+1A5FE9239C5237e008"; 07652 str >> CXSC_Ep2r[37]; 07653 str = "-1000000000002Ce000"; 07654 str >> CXSC_Ep2r[38]; 07655 str = "-1000000000002Be000"; 07656 str >> CXSC_Ep2r[39]; 07657 07658 CXSC_Ep2r_initialized = true; 07659 std::cout << RestoreOpt; 07660 } 07661 stagprec = stagmax; 07662 y = adjust(l_interval(0)); 07663 07664 for (int i=0; i<=stagmax; i++) 07665 y[i+1] = CXSC_Ep2r[i]; 07666 07667 stagprec = stagsave; 07668 y = adjust(y); 07669 07670 return lx_interval(-1025,y); 07671 } // 1/e^2 07672 07673 // ********************************************************************** 07674 07675 static real CXSC_Ep2Pi[40]; // CXSC_Ep2Pi[0], ... ,CXSC_Ep2Pi[39] 07676 static bool CXSC_Ep2Pi_initialized = false; 07677 07678 lx_interval Ep2Pi_lx_interval() throw() 07679 // Inclusion of e^(2pi), Blomquist, 27.11.2008; 07680 { 07681 l_interval y; 07682 int stagsave = stagprec, 07683 stagmax = 39; 07684 if (!CXSC_Ep2Pi_initialized) 07685 { 07686 std::string str; 07687 std::cout << SaveOpt; 07688 std::cout << Hex; 07689 str = "+10BBEEE9177E19e7FD"; 07690 str >> CXSC_Ep2Pi[0]; 07691 str = "+1C7DD9272526B1e7C5"; 07692 str >> CXSC_Ep2Pi[1]; 07693 str = "+15200F57AB89EDe78F"; 07694 str >> CXSC_Ep2Pi[2]; 07695 str = "-1FCCB6EDBE9C36e758"; 07696 str >> CXSC_Ep2Pi[3]; 07697 str = "+1BEA0BF179A589e722"; 07698 str >> CXSC_Ep2Pi[4]; 07699 str = "-1F3AD5A6B77F9Ee6EC"; 07700 str >> CXSC_Ep2Pi[5]; 07701 str = "-1622F702B57637e6B5"; 07702 str >> CXSC_Ep2Pi[6]; 07703 str = "-100C09AE818734e67C"; 07704 str >> CXSC_Ep2Pi[7]; 07705 str = "+10DA7ADA79EFE6e642"; 07706 str >> CXSC_Ep2Pi[8]; 07707 str = "+1FF9BF48B72959e60B"; 07708 str >> CXSC_Ep2Pi[9]; 07709 str = "-17AD7A3F6D2A14e5D5"; 07710 str >> CXSC_Ep2Pi[10]; 07711 str = "+1FCD4B0FA971E4e59E"; 07712 str >> CXSC_Ep2Pi[11]; 07713 str = "+193A2CDC04526Be567"; 07714 str >> CXSC_Ep2Pi[12]; 07715 str = "-18CBE5FDFAF25Fe531"; 07716 str >> CXSC_Ep2Pi[13]; 07717 str = "+1D47EEE171DA93e4FA"; 07718 str >> CXSC_Ep2Pi[14]; 07719 str = "-15B0F8DA29DB32e4C4"; 07720 str >> CXSC_Ep2Pi[15]; 07721 str = "-19207AD7E637D8e48C"; 07722 str >> CXSC_Ep2Pi[16]; 07723 str = "+191CA743F265A6e456"; 07724 str >> CXSC_Ep2Pi[17]; 07725 str = "+1A15069182EF28e41F"; 07726 str >> CXSC_Ep2Pi[18]; 07727 str = "-1D58BF80B501B6e3E9"; 07728 str >> CXSC_Ep2Pi[19]; 07729 str = "+1435920A849065e3B3"; 07730 str >> CXSC_Ep2Pi[20]; 07731 str = "-11931903C826FBe37C"; 07732 str >> CXSC_Ep2Pi[21]; 07733 str = "+169B0688CF564Ee346"; 07734 str >> CXSC_Ep2Pi[22]; 07735 str = "-12539A43ACDD10e309"; 07736 str >> CXSC_Ep2Pi[23]; 07737 str = "+172B8963B0CE58e2D3"; 07738 str >> CXSC_Ep2Pi[24]; 07739 str = "-13E6A7B1E3A306e29D"; 07740 str >> CXSC_Ep2Pi[25]; 07741 str = "-17F20768EDB9E7e267"; 07742 str >> CXSC_Ep2Pi[26]; 07743 str = "+130F006E28050Fe22F"; 07744 str >> CXSC_Ep2Pi[27]; 07745 str = "+149C245E1C5FEFe1F9"; 07746 str >> CXSC_Ep2Pi[28]; 07747 str = "-102CDEE5CA2F95e1C2"; 07748 str >> CXSC_Ep2Pi[29]; 07749 str = "+1040AABBBB0BFBe18B"; 07750 str >> CXSC_Ep2Pi[30]; 07751 str = "+18D7DB731409F2e154"; 07752 str >> CXSC_Ep2Pi[31]; 07753 str = "-1868ADF8479A20e11A"; 07754 str >> CXSC_Ep2Pi[32]; 07755 str = "+1BCB4CE8F6AF6Ae0E2"; 07756 str >> CXSC_Ep2Pi[33]; 07757 str = "-1A6BA8B081A793e0AC"; 07758 str >> CXSC_Ep2Pi[34]; 07759 str = "-1DE2841143A816e075"; 07760 str >> CXSC_Ep2Pi[35]; 07761 str = "+1CB5B248339C0Ee03F"; 07762 str >> CXSC_Ep2Pi[36]; 07763 str = "-1B1B84E7980944e007"; 07764 str >> CXSC_Ep2Pi[37]; 07765 str = "-10000000000003e000"; 07766 str >> CXSC_Ep2Pi[38]; 07767 str = "-10000000000002e000"; 07768 str >> CXSC_Ep2Pi[39]; 07769 07770 CXSC_Ep2Pi_initialized = true; 07771 std::cout << RestoreOpt; 07772 } 07773 stagprec = stagmax; 07774 y = adjust(l_interval(0)); 07775 07776 for (int i=0; i<=stagmax; i++) 07777 y[i+1] = CXSC_Ep2Pi[i]; 07778 07779 stagprec = stagsave; 07780 y = adjust(y); 07781 07782 return lx_interval(-1013,y); 07783 } // e^(2pi) 07784 07785 // ********************************************************************** 07786 07787 static real CXSC_EpPid2[40]; // CXSC_EpPid2[0], ... ,CXSC_EpPid2[39] 07788 static bool CXSC_EpPid2_initialized = false; 07789 07790 lx_interval EpPid2_lx_interval() throw() 07791 // Inclusion of e^(pi/2), Blomquist, 27.11.2008; 07792 { 07793 l_interval y; 07794 int stagsave = stagprec, 07795 stagmax = 39; 07796 if (!CXSC_EpPid2_initialized) 07797 { 07798 std::string str; 07799 std::cout << SaveOpt; 07800 std::cout << Hex; 07801 str = "+133DEDC855935Fe7FD"; 07802 str >> CXSC_EpPid2[0]; 07803 str = "+13E45A768FB73Ce7C7"; 07804 str >> CXSC_EpPid2[1]; 07805 str = "-1FB31CF300FF3Ce791"; 07806 str >> CXSC_EpPid2[2]; 07807 str = "-1E80D8BEB83F79e75B"; 07808 str >> CXSC_EpPid2[3]; 07809 str = "-14A3DE039142DDe722"; 07810 str >> CXSC_EpPid2[4]; 07811 str = "-18792D7A37282Be6E7"; 07812 str >> CXSC_EpPid2[5]; 07813 str = "-19DF43A5980C28e6B1"; 07814 str >> CXSC_EpPid2[6]; 07815 str = "-1C6F0F641C0D67e67B"; 07816 str >> CXSC_EpPid2[7]; 07817 str = "-1779C86C2DB5ACe645"; 07818 str >> CXSC_EpPid2[8]; 07819 str = "+168521EE91B16Fe60D"; 07820 str >> CXSC_EpPid2[9]; 07821 str = "+12530F905D97BDe5D7"; 07822 str >> CXSC_EpPid2[10]; 07823 str = "+13498112CB7585e5A1"; 07824 str >> CXSC_EpPid2[11]; 07825 str = "+1BA4546B13A434e56B"; 07826 str >> CXSC_EpPid2[12]; 07827 str = "+14FF791C56421Ce534"; 07828 str >> CXSC_EpPid2[13]; 07829 str = "-1F375C223A2152e4FE"; 07830 str >> CXSC_EpPid2[14]; 07831 str = "-126AB0C8C77412e4C8"; 07832 str >> CXSC_EpPid2[15]; 07833 str = "-1B39C9C0B8C54Ae490"; 07834 str >> CXSC_EpPid2[16]; 07835 str = "-167741414E31E3e459"; 07836 str >> CXSC_EpPid2[17]; 07837 str = "+1DEFB4462546C1e421"; 07838 str >> CXSC_EpPid2[18]; 07839 str = "-10F7B89CC30514e3E9"; 07840 str >> CXSC_EpPid2[19]; 07841 str = "+1E87D3145A3CEEe3B3"; 07842 str >> CXSC_EpPid2[20]; 07843 str = "+18AA09D5CD3B7Be37D"; 07844 str >> CXSC_EpPid2[21]; 07845 str = "+1E738C390E548Be347"; 07846 str >> CXSC_EpPid2[22]; 07847 str = "+147542CC36F28Be30E"; 07848 str >> CXSC_EpPid2[23]; 07849 str = "+1B217FFE679632e2D8"; 07850 str >> CXSC_EpPid2[24]; 07851 str = "+1A8F3962771086e2A0"; 07852 str >> CXSC_EpPid2[25]; 07853 str = "-187231F1E3EFC2e26A"; 07854 str >> CXSC_EpPid2[26]; 07855 str = "-15010B009CF001e233"; 07856 str >> CXSC_EpPid2[27]; 07857 str = "-1F22E68271119Fe1FB"; 07858 str >> CXSC_EpPid2[28]; 07859 str = "+11CA8D2164A3BAe1C5"; 07860 str >> CXSC_EpPid2[29]; 07861 str = "+1C20B237A324D7e18F"; 07862 str >> CXSC_EpPid2[30]; 07863 str = "-18C70E40461930e157"; 07864 str >> CXSC_EpPid2[31]; 07865 str = "+1025F32E109A37e120"; 07866 str >> CXSC_EpPid2[32]; 07867 str = "-12087D5EA8F469e0EA"; 07868 str >> CXSC_EpPid2[33]; 07869 str = "-14E1EE796B734Ae0B4"; 07870 str >> CXSC_EpPid2[34]; 07871 str = "-176EBB3BB1E41Ce07E"; 07872 str >> CXSC_EpPid2[35]; 07873 str = "+1374F617B0FF49e048"; 07874 str >> CXSC_EpPid2[36]; 07875 str = "+1D28C408575ECEe011"; 07876 str >> CXSC_EpPid2[37]; 07877 str = "-10000000006878e000"; 07878 str >> CXSC_EpPid2[38]; 07879 str = "-10000000006877e000"; 07880 str >> CXSC_EpPid2[39]; 07881 07882 CXSC_EpPid2_initialized = true; 07883 std::cout << RestoreOpt; 07884 } 07885 stagprec = stagmax; 07886 y = adjust(l_interval(0)); 07887 07888 for (int i=0; i<=stagmax; i++) 07889 y[i+1] = CXSC_EpPid2[i]; 07890 07891 stagprec = stagsave; 07892 y = adjust(y); 07893 07894 return lx_interval(-1020,y); 07895 } // e^(pi/2) 07896 07897 // ********************************************************************** 07898 07899 static real CXSC_EpPid4[40]; // CXSC_EpPid4[0], ... ,CXSC_EpPid4[39] 07900 static bool CXSC_EpPid4_initialized = false; 07901 07902 lx_interval EpPid4_lx_interval() throw() 07903 // Inclusion of e^(pi/4), Blomquist, 27.11.2008; 07904 { 07905 l_interval y; 07906 int stagsave = stagprec, 07907 stagmax = 39; 07908 if (!CXSC_EpPid4_initialized) 07909 { 07910 std::string str; 07911 std::cout << SaveOpt; 07912 std::cout << Hex; 07913 str = "+118BD669471CAAe7FD"; 07914 str >> CXSC_EpPid4[0]; 07915 str = "+1F0ED609715756e7C7"; 07916 str >> CXSC_EpPid4[1]; 07917 str = "-1B9C7B871FE1DBe791"; 07918 str >> CXSC_EpPid4[2]; 07919 str = "+15C0FECE98F209e75A"; 07920 str >> CXSC_EpPid4[3]; 07921 str = "+18C9FACC5DF3CEe724"; 07922 str >> CXSC_EpPid4[4]; 07923 str = "+15EDE838B4A399e6EC"; 07924 str >> CXSC_EpPid4[5]; 07925 str = "-1C7EFACA363051e6B6"; 07926 str >> CXSC_EpPid4[6]; 07927 str = "-1A1EBEA1646411e680"; 07928 str >> CXSC_EpPid4[7]; 07929 str = "+1AEF54E68CE03Be649"; 07930 str >> CXSC_EpPid4[8]; 07931 str = "-11250CB97FDDBFe60F"; 07932 str >> CXSC_EpPid4[9]; 07933 str = "-169ADC0E65B8A7e5D8"; 07934 str >> CXSC_EpPid4[10]; 07935 str = "+198A501DB90EDDe5A2"; 07936 str >> CXSC_EpPid4[11]; 07937 str = "-1586909A3F6365e56B"; 07938 str >> CXSC_EpPid4[12]; 07939 str = "+1BE542410F8CE7e535"; 07940 str >> CXSC_EpPid4[13]; 07941 str = "+1E7EEC51889EECe4FF"; 07942 str >> CXSC_EpPid4[14]; 07943 str = "-1913C9FC19333Ce4C9"; 07944 str >> CXSC_EpPid4[15]; 07945 str = "+1112C71EA1E6F0e492"; 07946 str >> CXSC_EpPid4[16]; 07947 str = "-1C4CCF0F5D1E14e45B"; 07948 str >> CXSC_EpPid4[17]; 07949 str = "+1AC4A72310FA27e425"; 07950 str >> CXSC_EpPid4[18]; 07951 str = "-13EC6A07AD7C15e3EE"; 07952 str >> CXSC_EpPid4[19]; 07953 str = "+1114CC16D255A3e3B6"; 07954 str >> CXSC_EpPid4[20]; 07955 str = "+17FA54DD584C6Ee380"; 07956 str >> CXSC_EpPid4[21]; 07957 str = "-1BBFE0D94FA881e34A"; 07958 str >> CXSC_EpPid4[22]; 07959 str = "-1AACE950D75AB5e314"; 07960 str >> CXSC_EpPid4[23]; 07961 str = "-1C197FC5941652e2DD"; 07962 str >> CXSC_EpPid4[24]; 07963 str = "-1FC33183282E6Ee2A7"; 07964 str >> CXSC_EpPid4[25]; 07965 str = "+15ADA6B92D282Ee26A"; 07966 str >> CXSC_EpPid4[26]; 07967 str = "-10CC6C2A9B1995e233"; 07968 str >> CXSC_EpPid4[27]; 07969 str = "+1767402CD3F07Be1FC"; 07970 str >> CXSC_EpPid4[28]; 07971 str = "-134D3B2AED1AACe1C5"; 07972 str >> CXSC_EpPid4[29]; 07973 str = "+1C87E322B76BC8e18D"; 07974 str >> CXSC_EpPid4[30]; 07975 str = "+1CBF921AE01812e157"; 07976 str >> CXSC_EpPid4[31]; 07977 str = "+16B04C1CCCDEAEe11D"; 07978 str >> CXSC_EpPid4[32]; 07979 str = "+11D2A5DAE175A6e0E5"; 07980 str >> CXSC_EpPid4[33]; 07981 str = "-1D6F0482D56D0Ee0AF"; 07982 str >> CXSC_EpPid4[34]; 07983 str = "-1E1B89C6DE0660e079"; 07984 str >> CXSC_EpPid4[35]; 07985 str = "-1202BA3792C129e042"; 07986 str >> CXSC_EpPid4[36]; 07987 str = "+1B23FE2BAFDF56e00A"; 07988 str >> CXSC_EpPid4[37]; 07989 str = "-100000000000DEe000"; 07990 str >> CXSC_EpPid4[38]; 07991 str = "-100000000000DDe000"; 07992 str >> CXSC_EpPid4[39]; 07993 07994 CXSC_EpPid4_initialized = true; 07995 std::cout << RestoreOpt; 07996 } 07997 stagprec = stagmax; 07998 y = adjust(l_interval(0)); 07999 08000 for (int i=0; i<=stagmax; i++) 08001 y[i+1] = CXSC_EpPid4[i]; 08002 08003 stagprec = stagsave; 08004 y = adjust(y); 08005 08006 return lx_interval(-1021,y); 08007 } // e^(pi/4) 08008 08009 08010 // ------------------------------------------------------------------------------ 08011 // ---------------- lx_real constants in high accuracy -------------------- 08012 // ------------------------------------------------------------------------------ 08013 08014 lx_real Pi_lx_real() throw() 08015 { return mid(Pi_lx_interval()); } 08016 lx_real Pip2_lx_real() throw() 08017 { return mid(Pip2_lx_interval()); } 08018 lx_real Pi2r_lx_real() throw() 08019 { return mid(Pi2r_lx_interval()); } 08020 lx_real Pi2_lx_real() throw() 08021 { return mid(Pi2_lx_interval()); } 08022 lx_real Pid4_lx_real() throw() 08023 { return mid(Pid4_lx_interval()); } 08024 lx_real Pid2_lx_real() throw() 08025 { return mid(Pid2_lx_interval()); } 08026 lx_real Ln2_lx_real() throw() 08027 { return mid(Ln2_lx_interval()); } 08028 lx_real Ln10_lx_real() throw() 08029 { return mid(Ln10_lx_interval()); } 08030 lx_real Ln10r_lx_real() throw() 08031 { return mid(Ln10r_lx_interval()); } 08032 lx_real Pir_lx_real() throw() 08033 { return mid(Pir_lx_interval()); } 08034 lx_real SqrtPi_lx_real() throw() 08035 { return mid(SqrtPi_lx_interval()); } 08036 lx_real Sqrt2Pi_lx_real() throw() 08037 { return mid(Sqrt2Pi_lx_interval()); } 08038 lx_real Sqrt2_lx_real() throw() 08039 { return mid(Sqrt2_lx_interval()); } 08040 lx_real Sqrt2r_lx_real() throw() 08041 { return mid(Sqrt2r_lx_interval()); } 08042 lx_real Sqrt3_lx_real() throw() 08043 { return mid(Sqrt3_lx_interval()); } 08044 lx_real Sqrt3r_lx_real() throw() 08045 { return mid(Sqrt3r_lx_interval()); } 08046 lx_real Sqrt3d2_lx_real() throw() 08047 { return mid(Sqrt3d2_lx_interval()); } 08048 lx_real Ln2r_lx_real() throw() 08049 { return mid(Ln2r_lx_interval()); } 08050 lx_real Pid3_lx_real() throw() 08051 { return mid(Pid3_lx_interval()); } 08052 lx_real SqrtPir_lx_real() throw() 08053 { return mid(SqrtPir_lx_interval()); } 08054 lx_real Sqrt2Pir_lx_real() throw() 08055 { return mid(Sqrt2Pir_lx_interval()); } 08056 lx_real LnPi_lx_real() throw() 08057 { return mid(LnPi_lx_interval()); } 08058 lx_real Ln2Pi_lx_real() throw() 08059 { return mid(Ln2Pi_lx_interval()); } 08060 lx_real E_lx_real() throw() 08061 { return mid(E_lx_interval()); } 08062 lx_real Ep2r_lx_real() throw() 08063 { return mid(Ep2r_lx_interval()); } 08064 lx_real Ep2_lx_real() throw() 08065 { return mid(Ep2_lx_interval()); } 08066 lx_real Er_lx_real() throw() 08067 { return mid(Er_lx_interval()); } 08068 lx_real EpPi_lx_real() throw() 08069 { return mid(EpPi_lx_interval()); } 08070 lx_real EpPid2_lx_real() throw() 08071 { return mid(EpPid2_lx_interval()); } 08072 lx_real EpPid4_lx_real() throw() 08073 { return mid(EpPid4_lx_interval()); } 08074 lx_real Ep2Pi_lx_real() throw() 08075 { return mid(Ep2Pi_lx_interval()); } 08076 lx_real EulerGamma_lx_real() throw() 08077 { return mid(EulerGamma_lx_interval()); } 08078 lx_real Catalan_lx_real() throw() 08079 { return mid(Catalan_lx_interval()); } 08080 lx_real sqrt5_lx_real() throw() 08081 { return mid(sqrt5_lx_interval()); } 08082 lx_real sqrt7_lx_real() throw() 08083 { return mid(sqrt7_lx_interval()); } 08084 lx_real One_m_lx_real() throw() 08085 { return mid(One_m_lx_interval()); } 08086 lx_real One_p_lx_real() throw() 08087 { return mid(One_p_lx_interval()); } 08088 08089 // -------------------------------------------------------------------------- 08090 // -------Elementary functions related to type lx_real ---------------------- 08091 // -------------------------------------------------------------------------- 08092 08093 lx_real sqrt(const lx_real& x) throw() 08094 { return mid(sqrt(lx_interval(x))); } 08095 lx_real sqr(const lx_real& x) throw() 08096 { return mid(sqr(lx_interval(x))); } 08097 lx_real ln(const lx_real& x) throw() 08098 { return mid(ln(lx_interval(x))); } 08099 lx_real log2(const lx_real& x) throw() 08100 { return mid(log2(lx_interval(x))); } 08101 lx_real log10(const lx_real& x) throw() 08102 { return mid(log10(lx_interval(x))); } 08103 lx_real lnp1(const lx_real& x) throw() 08104 { return mid(lnp1(lx_interval(x))); } 08105 lx_real exp(const lx_real& x) throw() 08106 { return mid(exp(lx_interval(x))); } 08107 lx_real exp2(const lx_real& x) throw() 08108 { return mid(exp2(lx_interval(x))); } 08109 lx_real exp10(const lx_real& x) throw() 08110 { return mid(exp10(lx_interval(x))); } 08111 lx_real expm1(const lx_real& x) throw() 08112 { return mid(expm1(lx_interval(x))); } 08113 lx_real power(const lx_real& x, const real& r) throw() 08114 { return mid(power(lx_interval(x),r)); } 08115 lx_real pow(const lx_real& x, const lx_real& y) throw() 08116 { return mid(pow(lx_interval(x),lx_interval(y))); } 08117 lx_real xp1_pow_y(const lx_real& x, const lx_real& y) throw() 08118 { return mid(xp1_pow_y(lx_interval(x),lx_interval(y))); } 08119 lx_real sin(const lx_real& x) throw() 08120 { return mid(sin(lx_interval(x))); } 08121 lx_real sin_n(const lx_real& x, const real& n) throw() 08122 { return mid(sin_n(lx_interval(x),n)); } 08123 lx_real cos(const lx_real& x) throw() 08124 { return mid(cos(lx_interval(x))); } 08125 lx_real cos_n(const lx_real& x, const real& n) throw() 08126 { return mid(cos_n(lx_interval(x),n)); } 08127 lx_real tan(const lx_real& x) throw() 08128 { return mid(tan(lx_interval(x))); } 08129 lx_real cot(const lx_real& x) throw() 08130 { return mid(cot(lx_interval(x))); } 08131 lx_real sqrt1px2(const lx_real& x) throw() 08132 { return mid(sqrt1px2(lx_interval(x))); } 08133 lx_real atan(const lx_real& x) throw() 08134 { return mid(atan(lx_interval(x))); } 08135 lx_real sqrt1mx2(const lx_real& x) throw() 08136 { return mid(sqrt1mx2(lx_interval(x))); } 08137 lx_real sqrtx2m1(const lx_real& x) throw() 08138 { return mid(sqrtx2m1(lx_interval(x))); } 08139 lx_real asin(const lx_real& x) throw() 08140 { return mid(asin(lx_interval(x))); } 08141 lx_real acos(const lx_real& x) throw() 08142 { return mid(acos(lx_interval(x))); } 08143 lx_real acot(const lx_real& x) throw() 08144 { return mid(acot(lx_interval(x))); } 08145 lx_real sinh(const lx_real& x) throw() 08146 { return mid(sinh(lx_interval(x))); } 08147 lx_real cosh(const lx_real& x) throw() 08148 { return mid(cosh(lx_interval(x))); } 08149 lx_real tanh(const lx_real& x) throw() 08150 { return mid(tanh(lx_interval(x))); } 08151 lx_real coth(const lx_real& x) throw() 08152 { return mid(coth(lx_interval(x))); } 08153 lx_real sqrtp1m1(const lx_real& x) throw() 08154 { return mid(sqrtp1m1(lx_interval(x))); } 08155 lx_real asinh(const lx_real& x) throw() 08156 { return mid(asinh(lx_interval(x))); } 08157 lx_real acosh(const lx_real& x) throw() 08158 { return mid(acosh(lx_interval(x))); } 08159 lx_real acoshp1(const lx_real& x) throw() 08160 { return mid(acoshp1(lx_interval(x))); } 08161 lx_real atanh(const lx_real& x) throw() 08162 { return mid(atanh(lx_interval(x))); } 08163 lx_real atanh1m(const lx_real& x) throw() 08164 { return mid(atanh1m(lx_interval(x))); } 08165 lx_real atanhm1p(const lx_real& x) throw() 08166 { return mid(atanhm1p(lx_interval(x))); } 08167 lx_real acoth(const lx_real& x) throw() 08168 { return mid(acoth(lx_interval(x))); } 08169 lx_real acothp1(const lx_real& x) throw() 08170 { return mid(acothp1(lx_interval(x))); } 08171 lx_real acothm1m(const lx_real& x) throw() 08172 { return mid(acothm1m(lx_interval(x))); } 08173 lx_real sqrtx2y2(const lx_real& x, const lx_real& y) throw() 08174 { return mid(sqrtx2y2(lx_interval(x),lx_interval(y))); } 08175 lx_real ln_sqrtx2y2(const lx_real& x, const lx_real& y) throw() 08176 { return mid(ln_sqrtx2y2(lx_interval(x),lx_interval(y))); } 08177 lx_real sqrt(const lx_real& x, int n) throw() 08178 { return mid(sqrt(lx_interval(x),n)); } 08179 08180 } // namespace cxsc