C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
l_real.hpp
1 /*
2 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
3 **
4 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
5 ** Universitaet Karlsruhe, Germany
6 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
7 ** Universitaet Wuppertal, Germany
8 **
9 ** This library is free software; you can redistribute it and/or
10 ** modify it under the terms of the GNU Library General Public
11 ** License as published by the Free Software Foundation; either
12 ** version 2 of the License, or (at your option) any later version.
13 **
14 ** This library is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ** Library General Public License for more details.
18 **
19 ** You should have received a copy of the GNU Library General Public
20 ** License along with this library; if not, write to the Free
21 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23 
24 /* CVS $Id: l_real.hpp,v 1.43 2014/01/30 17:23:46 cxsc Exp $ */
25 
26 #ifndef _CXSC_L_REAL_HPP_INCLUDED
27 #define _CXSC_L_REAL_HPP_INCLUDED
28 
29 #include <iostream>
30 #include <string>
31 #include <cstdlib>
32 
33 #include "dot.hpp"
34 #include "real.hpp"
35 #include "interval.hpp" // Blomquist 03.10.02; for _interval(t) in times2pown
36 #include "except.hpp"
37 
38 namespace cxsc {
39 
40 class l_interval;
41 class interval;
42 
43 #ifdef CXSC_USE_TLS_PREC
44 
45 #ifdef _WIN32
46 extern __declspec(thread) int stagprec;
47 #else
48 extern __thread int stagprec;
49 #endif
50 
51 #else
52 
53 extern int stagprec;
54 
55 #endif
56 
57 
58 
59 
61 
77 class l_real
78 {
79  private:
80  // ---- Data elements ----
81  int prec;
82  real *data;
83 
84  public:
85  // ---- Constructors ----
87  l_real(void) throw();
89  l_real(const l_real &) throw();
90 
91 
93  l_real & operator =(const l_real &) throw();
95  l_real & operator =(const real &) throw();
97  l_real & operator =(const dotprecision &) throw();
99  l_real & operator =(const lx_real &) throw(); // Blomquist, 12.11.2008;
100 
101  // ---- Destructors ----
102  ~l_real(void) throw();
103 
104  // ---- Type casting ----
106  explicit l_real(int) throw();
108  explicit l_real(long) throw();
110  explicit l_real(const real &) throw();
112  explicit l_real(const dotprecision &) throw();
114  explicit l_real(const double &) throw(); // Blomquist 10.09.02. {l_real.cpp}
115 
116  friend real::real(const l_real &) throw();
117  friend dotprecision::dotprecision(const l_real &) throw();
118  friend dotprecision & dotprecision::operator =(const l_real &) throw();
119 
120 // friend real _real(const l_real & a) throw() { return real(a); }
121 // friend l_real _l_real(const real & a) throw() { return l_real(a); }
122 // friend dotprecision _dotprecision(const l_real & a) throw()
123 // { return dotprecision(a); }
124 // friend l_real _l_real(const dotprecision & a) throw()
125 // { return l_real(a); }
126  friend l_interval _unchecked_l_interval(const l_real &,
127  const l_real &) throw();
128 
129  // The following are defined in the specific vector, matrix-files
130 #if(CXSC_INDEX_CHECK)
131  explicit INLINE l_real(const l_rvector &) throw (ERROR_LRVECTOR_TYPE_CAST_OF_THICK_OBJ,ERROR_LRVECTOR_USE_OF_UNINITIALIZED_OBJ);
134  explicit INLINE l_real(const l_rvector_slice &) throw (ERROR_LRVECTOR_TYPE_CAST_OF_THICK_OBJ,ERROR_LRVECTOR_USE_OF_UNINITIALIZED_OBJ);
136  explicit INLINE l_real(const l_rmatrix &) throw (ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_LRMATRIX_USE_OF_UNINITIALIZED_OBJ);
138  explicit INLINE l_real(const l_rmatrix_slice &) throw (ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_LRMATRIX_USE_OF_UNINITIALIZED_OBJ);
140 
145  friend INLINE real _l_real(const l_rvector &) throw (ERROR_LRVECTOR_TYPE_CAST_OF_THICK_OBJ,ERROR_LRVECTOR_USE_OF_UNINITIALIZED_OBJ);
147 
152  friend INLINE real _l_real(const l_rvector_slice &) throw (ERROR_LRVECTOR_TYPE_CAST_OF_THICK_OBJ,ERROR_LRVECTOR_USE_OF_UNINITIALIZED_OBJ);
154 
159  friend INLINE real _l_real(const l_rmatrix &) throw (ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_LRMATRIX_USE_OF_UNINITIALIZED_OBJ);
161 
166  friend INLINE real _l_real(const l_rmatrix_slice &) throw (ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_LRMATRIX_USE_OF_UNINITIALIZED_OBJ);
167 #else
168  explicit INLINE l_real(const l_rvector &) throw ();
171  explicit INLINE l_real(const l_rvector_slice &) throw ();
173  explicit INLINE l_real(const l_rmatrix &) throw ();
175  explicit INLINE l_real(const l_rmatrix_slice &) throw ();
177 
182  friend INLINE real _l_real(const l_rvector &) throw ();
184 
189  friend INLINE real _l_real(const l_rvector_slice &) throw ();
191 
196  friend INLINE real _l_real(const l_rmatrix &) throw ();
198 
203  friend INLINE real _l_real(const l_rmatrix_slice &) throw ();
204 #endif
205 
206 
207  // ---- Output functions ----
209  friend std::ostream & operator <<(std::ostream &,const l_real &) throw();
211  friend std::istream & operator >>(std::istream &,l_real &) throw();
213  friend std::string & operator <<(std::string &,const l_real &) throw();
215  friend std::string & operator >>(std::string &,l_real &) throw();
217  friend void operator >>(const std::string &,l_real &) throw();
219  friend void operator >>(const char *,l_real &) throw();
220 
221  // ---- Standard functions ---- (arithmetic operators)
223  real& operator[](int) const throw();
224 
226  friend l_real operator -(const l_real& lr1) throw();
228  friend l_real operator +(const l_real& lr1) throw();
229 
231  friend l_real operator +(const l_real &,const l_real &) throw();
233  friend l_real operator -(const l_real &,const l_real &) throw();
235  friend l_real operator *(const l_real &,const l_real &) throw();
237  friend l_real operator /(const l_real &,const l_real &) throw(DIV_BY_ZERO);
239  friend inline l_interval operator |(const l_real &,const l_real &) throw();
240 
242  friend l_real operator +(const l_real &,const real &) throw();
244  friend l_real operator +(const real &,const l_real &) throw();
246  friend l_real operator -(const l_real &,const real &) throw();
248  friend l_real operator -(const real &,const l_real &) throw();
250  friend l_real operator *(const l_real &,const real &) throw();
252  friend l_real operator *(const real &,const l_real &) throw();
254  friend l_real operator /(const l_real &,const real &) throw();
256  friend l_real operator /(const real &,const l_real &) throw();
258  friend inline l_interval operator |(const real &,const l_real &) throw();
260  friend inline l_interval operator |(const l_real &,const real &) throw();
261 
263  friend dotprecision operator +(const l_real &,const dotprecision &) throw();
265  friend dotprecision operator +(const dotprecision &,const l_real &) throw();
267  friend dotprecision operator -(const l_real &,const dotprecision &) throw();
269  friend dotprecision operator -(const dotprecision &,const l_real &) throw();
271  friend inline idotprecision operator |(const dotprecision &,const l_real &) throw();
273  friend inline idotprecision operator |(const l_real &,const dotprecision &) throw();
274 
276  friend l_real & operator +=(l_real &,const l_real &) throw();
278  friend l_real & operator -=(l_real &,const l_real &) throw();
280  friend l_real & operator *=(l_real &,const l_real &) throw();
282  friend l_real & operator /=(l_real &,const l_real &) throw();
283 
285  friend l_real & operator +=(l_real &,const real &) throw();
287  friend l_real & operator -=(l_real &,const real &) throw();
289  friend l_real & operator *=(l_real &,const real &) throw();
291  friend l_real & operator /=(l_real &,const real &) throw();
292 
294  friend real & operator +=(real &,const l_real &) throw();
296  friend real & operator -=(real &,const l_real &) throw();
298  friend real & operator *=(real &,const l_real &) throw();
300  friend real & operator /=(real &,const l_real &) throw();
301 
303  friend inline dotprecision & operator +=(dotprecision &d,const l_real &lr) throw() { lr._akku_add(d); return d; }
305  friend inline dotprecision & operator -=(dotprecision &d,const l_real &lr) throw() { lr._akku_sub(d); return d; }
306 
307  // ---- Compare operators ----
309  friend bool operator ==(const l_real &,const l_real &) throw();
311  friend bool operator !=(const l_real &,const l_real &) throw();
313  friend bool operator <(const l_real &,const l_real &) throw();
315  friend bool operator >(const l_real &,const l_real &) throw();
317  friend bool operator <=(const l_real &,const l_real &) throw();
319  friend bool operator >=(const l_real &,const l_real &) throw();
320 
322  friend bool operator ==(const real &,const l_real &) throw();
324  friend bool operator !=(const real &,const l_real &) throw();
326  friend bool operator <(const real &,const l_real &) throw();
328  friend bool operator >(const real &,const l_real &) throw();
330  friend bool operator <=(const real &,const l_real &) throw();
332  friend bool operator >=(const real &,const l_real &) throw();
333 
335  friend bool operator ==(const l_real &,const real &) throw();
337  friend bool operator !=(const l_real &,const real &) throw();
339  friend bool operator <(const l_real &,const real &) throw();
341  friend bool operator >(const l_real &,const real &) throw();
343  friend bool operator <=(const l_real &,const real &) throw();
345  friend bool operator >=(const l_real &,const real &) throw();
346 
348  friend bool operator ==(const dotprecision &,const l_real &) throw();
350  friend bool operator !=(const dotprecision &,const l_real &) throw();
352  friend bool operator <(const dotprecision &,const l_real &) throw();
354  friend bool operator >(const dotprecision &,const l_real &) throw();
356  friend bool operator <=(const dotprecision &,const l_real &) throw();
358  friend bool operator >=(const dotprecision &,const l_real &) throw();
359 
361  friend bool operator ==(const l_real &,const dotprecision &) throw();
363  friend bool operator !=(const l_real &,const dotprecision &) throw();
365  friend bool operator <(const l_real &,const dotprecision &) throw();
367  friend bool operator >(const l_real &,const dotprecision &) throw();
369  friend bool operator <=(const l_real &,const dotprecision &) throw();
371  friend bool operator >=(const l_real &,const dotprecision &) throw();
372 
374  friend bool operator ==(const interval &,const l_real &) throw();
376  friend bool operator !=(const interval &,const l_real &) throw();
378  friend bool operator <(const interval &,const l_real &) throw();
380  friend bool operator >(const interval &,const l_real &) throw();
382  friend bool operator <=(const interval &,const l_real &) throw();
384  friend bool operator >=(const interval &,const l_real &) throw();
385 
387  friend bool operator ==(const l_real &,const interval &) throw();
389  friend bool operator !=(const l_real &,const interval &) throw();
391  friend bool operator <(const l_real &,const interval &) throw();
393  friend bool operator >(const l_real &,const interval &) throw();
395  friend bool operator <=(const l_real &,const interval &) throw();
397  friend bool operator >=(const l_real &,const interval &) throw();
398 
400  friend bool operator ==(const idotprecision &,const l_real &) throw();
402  friend bool operator !=(const idotprecision &,const l_real &) throw();
404  friend bool operator <(const idotprecision &,const l_real &) throw();
406  friend bool operator >(const idotprecision &,const l_real &) throw();
408  friend bool operator <=(const idotprecision &,const l_real &) throw();
410  friend bool operator >=(const idotprecision &,const l_real &) throw();
411 
413  friend bool operator ==(const l_real &,const idotprecision &) throw();
415  friend bool operator !=(const l_real &,const idotprecision &) throw();
417  friend bool operator <(const l_real &,const idotprecision &) throw();
419  friend bool operator >(const l_real &,const idotprecision &) throw();
421  friend bool operator <=(const l_real &,const idotprecision &) throw();
423  friend bool operator >=(const l_real &,const idotprecision &) throw();
424 
425 
427  friend bool operator!(const l_real& lr) throw();
428 
429  // ---- functions ----
431  friend void accumulate(dotprecision&, const real&, const l_real&) throw();
433  friend void accumulate(dotprecision&, const l_real&, const real&) throw();
435  friend void accumulate(dotprecision&, const l_real&, const l_real&) throw();
436 
438  friend void accumulate(idotprecision&,const real&, const l_real&) throw();
440  friend void accumulate(idotprecision&,const l_real&,const real&) throw();
442  friend void accumulate(idotprecision&,const l_real&, const l_real&) throw();
443 
445  friend l_real abs (const l_real&) throw();
447  friend int sign (const l_real&) throw();
449  friend int StagPrec(const l_real&) throw();
451  friend l_real adjust(const l_real&) throw();
452 
454  friend l_real rnd_up(const dotprecision&); // Blomquist, 20.11.2006;
456  friend l_real rnd_down(const dotprecision&); // Blomquist, 20.11.2006;
457 
459  friend int expo_sm(const l_real&); // Blomquist, 25.03.2007;
460  // Calculating expo(x[k]) of the smallest |x[k]| <> 0.
461 
463  friend int expo_gr(const l_real&); // Blomquist, 25.03.2007;
464  // Calculating expo(x[k]) of the greatest |x[k]|.
465 
466  // ---- Friends -----
467 
469  friend inline l_real Inf(const l_interval &) throw();
471  friend inline l_real Sup(const l_interval &) throw();
473  friend l_real mid(const l_interval &) throw();
475  friend inline bool zero_(const l_real &) throw(); // Blomquist,27.11.02
476  private:
477  void _clear(int) throw(); // filling a l_real number from element int p
478  // up to the end with zero.
479  void _akku_out(const dotprecision&) throw(); // The dotprecision value is rounded to the
480  // activated l_real number in its own precision.
481  void _akku_out_up(const dotprecision&) throw(); // The dotprecision value is rounded up to
482  // the activated l_real number in its own precision.
483  void _akku_out_down(const dotprecision&) throw(); // The dotprecision value is rounded down
484  // to the activated l_real number in its own precision.
485  void _akku_add(dotprecision&) const throw(); // adding the activated
486  // l_real number to the accumulator d.
487  void _akku_sub(dotprecision&) const throw(); // subtracting the
488  // activated l_real number to the accumulator d of type dotprecision.
489  inline real& elem(int i) const throw() { return data[i-1]; }
490 };
491 
492 
493 
494  // ---- Compare operators ----
495  bool operator ==(const l_real &,const l_real &) throw();
496  bool operator !=(const l_real &,const l_real &) throw();
497  bool operator <(const l_real &,const l_real &) throw();
498  bool operator >(const l_real &,const l_real &) throw();
499  bool operator <=(const l_real &,const l_real &) throw();
500  bool operator >=(const l_real &,const l_real &) throw();
501 
502  bool operator ==(const real &,const l_real &) throw();
503  bool operator !=(const real &,const l_real &) throw();
504  bool operator <(const real &,const l_real &) throw();
505  bool operator >(const real &,const l_real &) throw();
506  bool operator <=(const real &,const l_real &) throw();
507  bool operator >=(const real &,const l_real &) throw();
508 
509  bool operator ==(const l_real &,const real &) throw();
510  bool operator !=(const l_real &,const real &) throw();
511  bool operator <(const l_real &,const real &) throw();
512  bool operator >(const l_real &,const real &) throw();
513  bool operator <=(const l_real &,const real &) throw();
514  bool operator >=(const l_real &,const real &) throw();
515 
516  bool operator ==(const dotprecision &,const l_real &) throw();
517  bool operator !=(const dotprecision &,const l_real &) throw();
518  bool operator <(const dotprecision &,const l_real &) throw();
519  bool operator >(const dotprecision &,const l_real &) throw();
520  bool operator <=(const dotprecision &,const l_real &) throw();
521  bool operator >=(const dotprecision &,const l_real &) throw();
522 
523  bool operator ==(const l_real &,const dotprecision &) throw();
524  bool operator !=(const l_real &,const dotprecision &) throw();
525  bool operator <(const l_real &,const dotprecision &) throw();
526  bool operator >(const l_real &,const dotprecision &) throw();
527  bool operator <=(const l_real &,const dotprecision &) throw();
528  bool operator >=(const l_real &,const dotprecision &) throw();
529 
530  bool operator ==(const interval &,const l_real &) throw();
531  bool operator !=(const interval &,const l_real &) throw();
532  bool operator <(const interval &,const l_real &) throw();
533  bool operator >(const interval &,const l_real &) throw();
534  bool operator <=(const interval &,const l_real &) throw();
535  bool operator >=(const interval &,const l_real &) throw();
536 
537  bool operator ==(const l_real &,const interval &) throw();
538  bool operator !=(const l_real &,const interval &) throw();
539  bool operator <(const l_real &,const interval &) throw();
540  bool operator >(const l_real &,const interval &) throw();
541  bool operator <=(const l_real &,const interval &) throw();
542  bool operator >=(const l_real &,const interval &) throw();
543 
544  bool operator ==(const idotprecision &,const l_real &) throw();
545  bool operator !=(const idotprecision &,const l_real &) throw();
546  bool operator <(const idotprecision &,const l_real &) throw();
547  bool operator >(const idotprecision &,const l_real &) throw();
548  bool operator <=(const idotprecision &,const l_real &) throw();
549  bool operator >=(const idotprecision &,const l_real &) throw();
550 
551  bool operator ==(const l_real &,const idotprecision &) throw();
552  bool operator !=(const l_real &,const idotprecision &) throw();
553  bool operator <(const l_real &,const idotprecision &) throw();
554  bool operator >(const l_real &,const idotprecision &) throw();
555  bool operator <=(const l_real &,const idotprecision &) throw();
556  bool operator >=(const l_real &,const idotprecision &) throw();
557 
558 
559  bool operator!(const l_real& lr) throw();
560 
561 
562 inline real _real(const l_real & a) throw() { return real(a); }
563 inline l_real _l_real(const real & a) throw() { return l_real(a); }
564 inline dotprecision _dotprecision(const l_real & a) throw()
565  { return dotprecision(a); }
566 inline l_real _l_real(const dotprecision & a) throw()
567  { return l_real(a); }
568 l_interval _unchecked_l_interval(const l_real &, const l_real &) throw();
569 
571 l_real rnd_up(const dotprecision&); // Blomquist, 20.11.2006;
573 l_real rnd_down(const dotprecision&); // Blomquist, 20.11.2006;
574 
576  inline l_real l_pow2n(const int n) throw()
577 { // Fast and exact calculation of 2^n; -1074 <= n <= 1023;
578  // Blomquist 01.10.02.
579  return l_real( comp(0.5,n+1) );
580 }
581 
583 inline void times2pown(l_real& lr, const int n) throw() // Blomquist 03.10.02
584 { // lr is multiplied with 2^n; if lr[i]*2^n are all normalized, the result
585  // is exact. if one of the lr[i]*2^n are denormalized, the result is not
586  // exact in general.
587  int k = StagPrec(lr);
588  for (int i=1; i<=k; i++)
589  {
590  times2pown(lr[i],n);
591  }
592 }
593 
595 
607 inline void times2pown(l_real& lr, interval& z, const int n) throw()
608 { // Blomquist 03.10.02;
609 
610  if ( n<-1074 || n>1023 )
611  { std::cerr << "Error in: "
612  << "times2pown(l_real& lr, interval& z, const int n): " << std::endl
613  << " -1074 <= n <= +1023 not fulfilled" << std::endl; exit(0); }
614  int k = StagPrec(lr);
615  z = 0;
616  real mt,t;
617  real F = comp(0.5,n+1);
618  for (int i=1; i<=k; i++)
619  {
620  mt = mant(lr[i]);
621  t = lr[i];
622  times2pown(lr[i],n);
623  if ( mt != mant(lr[i]) )
624  {
625  lr[i] = 0;
626  z += _interval(t) * F;
627  }
628  }
629 
630 }
631 
633 
644 inline void Times2pown(l_real& a, interval& z, int n) throw()
645 // If we denote the old value of a with y then with the
646 // new calculated values of a and z it holds:
647 // ----- a+z is an inclusion of y*2^n; ------
648 // If z==0 then it holds a = y*2^n; (exact multiplication!).
649 // Especially, if n>=0, the multiplication with 2^n is exact
650 // if no oveflow occurs.
651 {
652  int fac,rest;
653  interval z1;
654  z=0;
655  if (n>=0)
656  { // if (n>=0) a*2^n is exactly calculated
657  // if no overflow occurs:
658  fac = n/1023; rest = n%1023;
659  for (int k=1; k<=fac; k++)
660  times2pown(a,1023);
661  times2pown(a,rest);
662  }
663  else // n < 0:
664  if (n<-2100)
665  {
666  if(a>0) z = interval(0,minreal);
667  else
668  if (a<0) z = interval(-minreal,0);
669  else z=0;
670  a = 0;
671  } else // -2100<=n<0
672  {
673  fac = n/-1074; rest = n%-1074;
674  for (int k=1; k<=fac; k++)
675  {
676  times2pown(a,z1,-1074);
677  times2pown(z,-1074);
678  z += z1;
679  }
680  times2pown(a,z1,rest);
681  times2pown(z,rest);
682  z += z1;
683  }
684 } // void Times2pown(...)
685 
687 
695 inline void Times2pown(l_real& a, const real& p) throw()
696 // The first parameter delivers an approximation of a * 2^p;
697 // For p in [-2100,+2100] p must be an integer value.
698 // This condition is NOT tested in this function!
699 // For p outside [-2100,+2100] an approximation of a * 2^p is
700 // calculated for any p of type real, unless an overflow occurs.
701 // If the function is activated with the second parameter of type int,
702 // then the first parameter delivers approximations of a * 2^p,
703 // unless an overflow occurs.
704 // Blomquist, 04.11.2008;
705 {
706  const int c1 = -1000000,
707  c2 = 2100,
708  c3 = 1023,
709  c4 = -1074;
710  int ex(expo_gr(a)),fac,rest,n;
711  double dbl;
712 
713  if (ex > c1)
714  {
715  if (p>=0)
716  if (p>c2)
717  times2pown(a,c2); // Produces an error
718  else // 0 <= p <= 2100
719  { // By too great p-values overflow is possible!
720  dbl = _double(p);
721  n = (int) dbl;
722  fac = n/c3;
723  rest = n%c3;
724  for (int k=1; k<=fac; k++)
725  times2pown(a,c3);
726  times2pown(a,rest);
727  }
728  else // p<0; No overflow or underflow!
729  if (p<-c2) a = 0.0;
730  else // -2100 <= p < 0
731  {
732  dbl = _double(p);
733  n = (int) dbl;
734  fac = n/c4;
735  rest = n%c4;
736  for (int k=1; k<=fac; k++)
737  times2pown(a,c4);
738  times2pown(a,rest);
739  }
740  }
741 } // Times2pown(...)
742 
743 
744 inline bool zero_(const l_real& lr) throw()
745 { // returns only true if all lr.elem(i) == 0; Blomquist, 27.11.02;
746  int i=1, p=StagPrec(lr);
747  bool tmp = true;
748  do
749  {
750  if (sign(lr.elem(i))!=0) tmp = false;
751  i++;
752  } while(tmp && i <= p );
753  return tmp;
754 }
755 
756 // real staggered constants:
758 l_real Ln2_l_real() throw(); // ln(2)
760 l_real Ln10_l_real() throw(); // ln(10)
762 l_real Ln10r_l_real() throw(); // 1/ln(10)
764 l_real Pid4_l_real() throw(); // Pi/4
766 l_real Sqrt2_l_real() throw(); // sqrt(2)
768 l_real Sqrt5_l_real() throw(); // sqrt(5)
770 l_real Sqrt7_l_real() throw(); // sqrt(7)
772 l_real Ln2r_l_real() throw(); // 1/ln(2)
774 l_real Pi_l_real() throw(); // Pi
776 l_real Pid2_l_real() throw(); // Pi/2
778 l_real Pi2_l_real() throw(); // 2*Pi
780 l_real Pid3_l_real() throw(); // Pi/3
782 l_real Pir_l_real() throw(); // 1/Pi
784 l_real Pi2r_l_real() throw(); // 1/(2*Pi)
786 l_real SqrtPi_l_real() throw(); // sqrt(Pi)
788 l_real Sqrt2Pi_l_real() throw(); // sqrt(2*Pi)
790 l_real SqrtPir_l_real() throw(); // 1/sqrt(Pi)
792 l_real Sqrt2Pir_l_real() throw(); // 1/sqrt(2*Pi)
794 l_real Pip2_l_real() throw(); // Pi^2
796 l_real Sqrt2r_l_real() throw(); // 1/sqrt(2)
798 l_real Sqrt3_l_real() throw(); // sqrt(3)
800 l_real Sqrt3d2_l_real() throw(); // sqrt(3)/2
802 l_real Sqrt3r_l_real() throw(); // 1/sqrt(3)
804 l_real LnPi_l_real() throw(); // ln(Pi)
806 l_real Ln2Pi_l_real() throw(); // ln(2*Pi)
808 l_real E_l_real() throw(); // e = exp(1)
810 l_real Er_l_real() throw(); // 1/e
812 l_real Ep2_l_real() throw(); // e^2
814 l_real Ep2r_l_real() throw(); // 1/e^2
816 l_real EpPi_l_real() throw(); // e^Pi
818 l_real Ep2Pi_l_real() throw(); // e^(2*Pi)
820 l_real EpPid2_l_real() throw(); // e^(Pi/2)
822 l_real EpPid4_l_real() throw(); // e^(Pi/4)
824 l_real EulerGa_l_real() throw(); // EulerGamma
826 l_real Catalan_l_real() throw(); // Catalan
827 
828 } // namespace cxsc
829 
830 #endif // _CXSC_L_REAL_HPP_INCLUDED
831 
dotprecision _dotprecision(const real &d)
Definition: dot.hpp:304
The Multiple-Precision Data Type l_rmatrix_slice.
Definition: l_rmatrix.hpp:999
l_real Ep2Pi_l_real()
Approximation of .
Definition: l_rmath.cpp:268
friend l_interval operator|(const l_real &, const l_real &)
Returns the convex hull of the arguments.
Definition: l_interval.inl:205
The Multiple-Precision Data Type l_interval.
Definition: l_interval.hpp:71
friend bool operator==(const l_real &, const l_real &)
Implementation of standard equality operation.
Definition: l_real.cpp:554
friend l_real operator -(const l_real &lr1)
Implementation of standard algebraic negative sign operation.
l_real E_l_real()
Approximation of .
Definition: l_rmath.cpp:258
friend int sign(const l_real &)
The sign of a l_real value.
Definition: l_real.cpp:684
The Data Type idotprecision.
Definition: idot.hpp:47
l_real Pip2_l_real()
Approximation of .
Definition: l_rmath.cpp:244
l_real EpPid2_l_real()
Approximation of .
Definition: l_rmath.cpp:270
The Multiple-Precision Data Type l_real.
Definition: l_real.hpp:77
The Data Type dotprecision.
Definition: dot.hpp:111
l_real Pir_l_real()
Approximation of .
Definition: l_rmath.cpp:232
l_real Ln2_l_real()
Approximation of .
Definition: l_rmath.cpp:208
friend bool operator<=(const l_real &, const l_real &)
Implementation of standard less-or-equal-than operation.
Definition: l_real.cpp:563
l_real EpPi_l_real()
Approximation of .
Definition: l_rmath.cpp:266
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
l_real Ln10r_l_real()
Approximation of .
Definition: l_rmath.cpp:212
real & operator[](int) const
Access to the single components used to store the long data type value.
Definition: l_real.cpp:302
friend std::istream & operator >>(std::istream &, l_real &)
Implementation of standard input method.
l_real l_pow2n(const int n)
Fast calculation of .
Definition: l_real.hpp:576
l_real Sqrt3r_l_real()
Approximation of .
Definition: l_rmath.cpp:252
The Scalar Type interval.
Definition: interval.hpp:54
friend l_real abs(const l_real &)
The absolute value of a l_real value.
Definition: l_real.cpp:670
l_real EulerGa_l_real()
Approximation of Euler Gamma.
Definition: l_rmath.cpp:274
friend int StagPrec(const l_real &)
Returns the precision of the long datatype value.
Definition: l_real.cpp:312
l_real SqrtPi_l_real()
Approximation of .
Definition: l_rmath.cpp:236
friend l_real & operator/=(l_real &, const l_real &)
Implementation of standard algebraic division and allocation operation.
Definition: l_real.cpp:552
l_real Pi2r_l_real()
Approximation of .
Definition: l_rmath.cpp:234
l_real Ln10_l_real()
Approximation of .
Definition: l_rmath.cpp:210
l_real Sqrt3_l_real()
Approximation of .
Definition: l_rmath.cpp:248
l_real Sqrt3d2_l_real()
Approximation of .
Definition: l_rmath.cpp:250
friend void accumulate(dotprecision &, const real &, const l_real &)
The accurate scalar product of the last two arguments added to the value of the first argument.
Definition: l_real.cpp:359
l_real & operator=(const l_real &)
Implementation of standard assigning operator.
Definition: l_real.cpp:274
l_real LnPi_l_real()
Approximation of .
Definition: l_rmath.cpp:254
friend bool operator!(const l_real &lr)
Implementation of standard negation operation.
Definition: l_real.cpp:572
l_real Ep2_l_real()
Approximation of .
Definition: l_rmath.cpp:262
friend dotprecision & operator -=(dotprecision &d, const l_real &lr)
Implementation of standard algebraic subtraction and allocation operation.
Definition: l_real.hpp:305
l_real rnd_up(const dotprecision &a)
Rounds the argument up to the next l_real value.
Definition: l_real.cpp:387
friend l_real Inf(const l_interval &)
Returns the infimum of an l_interval.
Definition: l_interval.inl:376
friend bool operator >(const l_real &, const l_real &)
Implementation of standard greater-than operation.
dotprecision & operator=(const dotprecision &)
Implementation of standard assigning operator.
Definition: dot.cpp:84
The Multiple-Precision Data Type l_rmatrix.
Definition: l_rmatrix.hpp:415
l_real SqrtPir_l_real()
Approximation of .
Definition: l_rmath.cpp:240
friend l_real operator/(const l_real &, const l_real &)
Implementation of standard algebraic division operation.
Definition: l_real.cpp:517
l_real Ln2r_l_real()
Approximation of .
Definition: l_rmath.cpp:222
l_real Ln2Pi_l_real()
Approximation of .
Definition: l_rmath.cpp:256
l_real Er_l_real()
Approximation of .
Definition: l_rmath.cpp:260
friend l_real operator+(const l_real &lr1)
Implementation of standard algebraic positive sign operation.
Definition: l_real.cpp:482
l_real Pi2_l_real()
Approximation of .
Definition: l_rmath.cpp:228
l_real Sqrt7_l_real()
Approximation of .
Definition: l_rmath.cpp:220
friend l_real rnd_down(const dotprecision &)
Rounds the argument down to the next l_real value.
Definition: l_real.cpp:394
friend bool zero_(const l_real &)
Checks if the argument is zero.
Definition: l_real.hpp:744
friend l_real operator *(const l_real &, const l_real &)
Implementation of standard algebraic multiplication operation.
Definition: l_real.cpp:508
friend bool operator !=(const l_real &, const l_real &)
Implementation of standard negated equality operation.
dotprecision(void)
Constructor of class dotprecision.
Definition: dot.cpp:62
l_real Pid2_l_real()
Approximation of .
Definition: l_rmath.cpp:226
l_real Pid3_l_real()
Approximation of .
Definition: l_rmath.cpp:230
l_real(void)
Constructor of class l_real.
Definition: l_real.cpp:174
friend l_real rnd_up(const dotprecision &)
Rounds the argument up to the next l_real value.
Definition: l_real.cpp:387
friend int expo_gr(const l_real &)
Returns the maximum of the expo-function.
Definition: l_real.cpp:744
real(void)
Constructor of class real.
Definition: real.hpp:122
friend l_real Sup(const l_interval &)
Returns the supremum of an l_interval.
Definition: l_interval.inl:390
l_real Pid4_l_real()
Approximation of .
Definition: l_rmath.cpp:214
friend l_real & operator+=(l_real &, const l_real &)
Implementation of standard algebraic addition and allocation operation.
Definition: l_real.cpp:550
The Multiple-Precision Data Type l_rvector.
Definition: l_rvector.hpp:53
void times2pown(cinterval &x, int n)
Fast multiplication of reference parameter [z] with .
Definition: cimath.cpp:2059
l_real Catalan_l_real()
Approximation of Catalan Numbers.
Definition: l_rmath.cpp:276
l_real Sqrt2_l_real()
Approximation of .
Definition: l_rmath.cpp:216
friend real _l_real(const l_rvector &)
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
friend l_real adjust(const l_real &)
Sets the precision of a specific long datatype value.
Definition: l_real.cpp:691
friend std::ostream & operator<<(std::ostream &, const l_real &)
Implementation of standard output method.
Definition: l_real.cpp:325
int expo_gr(const l_interval &x)
Definition: l_interval.inl:522
const real minreal
Smallest positive denormalized representable floating-point number.
Definition: real.cpp:63
l_real rnd_down(const dotprecision &a)
Rounds the argument down to the next l_real value.
Definition: l_real.cpp:394
friend l_real mid(const l_interval &)
Returns the rounded middle of the l_interval.
Definition: l_interval.cpp:568
l_real Sqrt2Pi_l_real()
Approximation of .
Definition: l_rmath.cpp:238
l_real Ep2r_l_real()
Approximation of .
Definition: l_rmath.cpp:264
l_real Sqrt5_l_real()
Approximation of .
Definition: l_rmath.cpp:218
l_real EpPid4_l_real()
Approximation of .
Definition: l_rmath.cpp:272
friend l_real & operator -=(l_real &, const l_real &)
Implementation of standard algebraic subtraction and allocation operation.
The Scalar Type real.
Definition: real.hpp:113
The Multiple-Precision Data Type l_rvector_slice.
Definition: l_rvector.hpp:744
l_real Pi_l_real()
Approximation of .
Definition: l_rmath.cpp:224
friend l_real & operator *=(l_real &, const l_real &)
Implementation of standard algebraic multiplication and allocation operation.
Definition: l_real.cpp:551
friend int expo_sm(const l_real &)
Returns the minimum of the expo-function.
Definition: l_real.cpp:725
friend bool operator >=(const l_real &, const l_real &)
Implementation of standard greater-or-equal-than operation.
l_real Sqrt2r_l_real()
Approximation of .
Definition: l_rmath.cpp:246
friend bool operator<(const l_real &, const l_real &)
Implementation of standard less-than operation.
Definition: l_real.cpp:580
l_real Sqrt2Pir_l_real()
Approximation of .
Definition: l_rmath.cpp:242