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
38namespace cxsc {
39
40class l_interval;
41class interval;
42
43#ifdef CXSC_USE_TLS_PREC
44
45#ifdef _WIN32
46extern __declspec(thread) int stagprec;
47#else
48extern __thread int stagprec;
49#endif
50
51#else
52
53extern int stagprec;
54
55#endif
56
57
58
59
61
77class l_real
78{
79 private:
80 // ---- Data elements ----
81 int prec;
82 real *data;
83
84 public:
85 // ---- Constructors ----
87 l_real(void) noexcept;
89 l_real(const l_real &) noexcept;
90
91
93 l_real & operator =(const l_real &) noexcept;
95 l_real & operator =(const real &) noexcept;
97 l_real & operator =(const dotprecision &) noexcept;
99 l_real & operator =(const lx_real &) noexcept; // Blomquist, 12.11.2008;
100
101 // ---- Destructors ----
102 ~l_real(void) noexcept;
103
104 // ---- Type casting ----
106 explicit l_real(int) noexcept;
108 explicit l_real(long) noexcept;
110 explicit l_real(const real &) noexcept;
112 explicit l_real(const dotprecision &) noexcept;
114 explicit l_real(const double &) noexcept; // Blomquist 10.09.02. {l_real.cpp}
115
116 friend real::real(const l_real &) noexcept;
117 friend dotprecision::dotprecision(const l_real &) noexcept;
118 friend dotprecision & dotprecision::operator =(const l_real &) noexcept;
119
120// friend real _real(const l_real & a) noexcept { return real(a); }
121// friend l_real _l_real(const real & a) noexcept { return l_real(a); }
122// friend dotprecision _dotprecision(const l_real & a) noexcept
123// { return dotprecision(a); }
124// friend l_real _l_real(const dotprecision & a) noexcept
125// { return l_real(a); }
126 friend l_interval _unchecked_l_interval(const l_real &,
127 const l_real &) noexcept;
128
129 // The following are defined in the specific vector, matrix-files
130#if(CXSC_INDEX_CHECK)
132 explicit INLINE l_real(const l_rvector &) ;
134 explicit INLINE l_real(const l_rvector_slice &);
136 explicit INLINE l_real(const l_rmatrix &) ;
138 explicit INLINE l_real(const l_rmatrix_slice &);
140
145 friend INLINE real _l_real(const l_rvector &) ;
147
152 friend INLINE real _l_real(const l_rvector_slice &);
154
159 friend INLINE real _l_real(const l_rmatrix &) ;
161
166 friend INLINE real _l_real(const l_rmatrix_slice &);
167#else
169 explicit INLINE l_real(const l_rvector &) noexcept;
171 explicit INLINE l_real(const l_rvector_slice &) noexcept;
173 explicit INLINE l_real(const l_rmatrix &) noexcept;
175 explicit INLINE l_real(const l_rmatrix_slice &) noexcept;
177
182 friend INLINE real _l_real(const l_rvector &) noexcept;
184
189 friend INLINE real _l_real(const l_rvector_slice &) noexcept;
191
196 friend INLINE real _l_real(const l_rmatrix &) noexcept;
198
203 friend INLINE real _l_real(const l_rmatrix_slice &) noexcept;
204#endif
205
206
207 // ---- Output functions ----
209 friend std::ostream & operator <<(std::ostream &,const l_real &) noexcept;
211 friend std::istream & operator >>(std::istream &,l_real &) noexcept;
213 friend std::string & operator <<(std::string &,const l_real &) noexcept;
215 friend std::string & operator >>(std::string &,l_real &) noexcept;
217 friend void operator >>(const std::string &,l_real &) noexcept;
219 friend void operator >>(const char *,l_real &) noexcept;
220
221 // ---- Standard functions ---- (arithmetic operators)
223 real& operator[](int) const noexcept;
224
226 friend l_real operator -(const l_real& lr1) noexcept;
228 friend l_real operator +(const l_real& lr1) noexcept;
229
231 friend l_real operator +(const l_real &,const l_real &) noexcept;
233 friend l_real operator -(const l_real &,const l_real &) noexcept;
235 friend l_real operator *(const l_real &,const l_real &) noexcept;
237 friend l_real operator /(const l_real &,const l_real &);
239 friend inline l_interval operator |(const l_real &,const l_real &) noexcept;
240
242 friend l_real operator +(const l_real &,const real &) noexcept;
244 friend l_real operator +(const real &,const l_real &) noexcept;
246 friend l_real operator -(const l_real &,const real &) noexcept;
248 friend l_real operator -(const real &,const l_real &) noexcept;
250 friend l_real operator *(const l_real &,const real &) noexcept;
252 friend l_real operator *(const real &,const l_real &) noexcept;
254 friend l_real operator /(const l_real &,const real &) noexcept;
256 friend l_real operator /(const real &,const l_real &) noexcept;
258 friend inline l_interval operator |(const real &,const l_real &) noexcept;
260 friend inline l_interval operator |(const l_real &,const real &) noexcept;
261
263 friend dotprecision operator +(const l_real &,const dotprecision &) noexcept;
265 friend dotprecision operator +(const dotprecision &,const l_real &) noexcept;
267 friend dotprecision operator -(const l_real &,const dotprecision &) noexcept;
269 friend dotprecision operator -(const dotprecision &,const l_real &) noexcept;
271 friend inline idotprecision operator |(const dotprecision &,const l_real &) noexcept;
273 friend inline idotprecision operator |(const l_real &,const dotprecision &) noexcept;
274
276 friend l_real & operator +=(l_real &,const l_real &) noexcept;
278 friend l_real & operator -=(l_real &,const l_real &) noexcept;
280 friend l_real & operator *=(l_real &,const l_real &) noexcept;
282 friend l_real & operator /=(l_real &,const l_real &) noexcept;
283
285 friend l_real & operator +=(l_real &,const real &) noexcept;
287 friend l_real & operator -=(l_real &,const real &) noexcept;
289 friend l_real & operator *=(l_real &,const real &) noexcept;
291 friend l_real & operator /=(l_real &,const real &) noexcept;
292
294 friend real & operator +=(real &,const l_real &) noexcept;
296 friend real & operator -=(real &,const l_real &) noexcept;
298 friend real & operator *=(real &,const l_real &) noexcept;
300 friend real & operator /=(real &,const l_real &) noexcept;
301
303 friend inline dotprecision & operator +=(dotprecision &d,const l_real &lr) noexcept { lr._akku_add(d); return d; }
305 friend inline dotprecision & operator -=(dotprecision &d,const l_real &lr) noexcept { lr._akku_sub(d); return d; }
306
307 // ---- Compare operators ----
309 friend bool operator ==(const l_real &,const l_real &) noexcept;
311 friend bool operator !=(const l_real &,const l_real &) noexcept;
313 friend bool operator <(const l_real &,const l_real &) noexcept;
315 friend bool operator >(const l_real &,const l_real &) noexcept;
317 friend bool operator <=(const l_real &,const l_real &) noexcept;
319 friend bool operator >=(const l_real &,const l_real &) noexcept;
320
322 friend bool operator ==(const real &,const l_real &) noexcept;
324 friend bool operator !=(const real &,const l_real &) noexcept;
326 friend bool operator <(const real &,const l_real &) noexcept;
328 friend bool operator >(const real &,const l_real &) noexcept;
330 friend bool operator <=(const real &,const l_real &) noexcept;
332 friend bool operator >=(const real &,const l_real &) noexcept;
333
335 friend bool operator ==(const l_real &,const real &) noexcept;
337 friend bool operator !=(const l_real &,const real &) noexcept;
339 friend bool operator <(const l_real &,const real &) noexcept;
341 friend bool operator >(const l_real &,const real &) noexcept;
343 friend bool operator <=(const l_real &,const real &) noexcept;
345 friend bool operator >=(const l_real &,const real &) noexcept;
346
348 friend bool operator ==(const dotprecision &,const l_real &) noexcept;
350 friend bool operator !=(const dotprecision &,const l_real &) noexcept;
352 friend bool operator <(const dotprecision &,const l_real &) noexcept;
354 friend bool operator >(const dotprecision &,const l_real &) noexcept;
356 friend bool operator <=(const dotprecision &,const l_real &) noexcept;
358 friend bool operator >=(const dotprecision &,const l_real &) noexcept;
359
361 friend bool operator ==(const l_real &,const dotprecision &) noexcept;
363 friend bool operator !=(const l_real &,const dotprecision &) noexcept;
365 friend bool operator <(const l_real &,const dotprecision &) noexcept;
367 friend bool operator >(const l_real &,const dotprecision &) noexcept;
369 friend bool operator <=(const l_real &,const dotprecision &) noexcept;
371 friend bool operator >=(const l_real &,const dotprecision &) noexcept;
372
374 friend bool operator ==(const interval &,const l_real &) noexcept;
376 friend bool operator !=(const interval &,const l_real &) noexcept;
378 friend bool operator <(const interval &,const l_real &) noexcept;
380 friend bool operator >(const interval &,const l_real &) noexcept;
382 friend bool operator <=(const interval &,const l_real &) noexcept;
384 friend bool operator >=(const interval &,const l_real &) noexcept;
385
387 friend bool operator ==(const l_real &,const interval &) noexcept;
389 friend bool operator !=(const l_real &,const interval &) noexcept;
391 friend bool operator <(const l_real &,const interval &) noexcept;
393 friend bool operator >(const l_real &,const interval &) noexcept;
395 friend bool operator <=(const l_real &,const interval &) noexcept;
397 friend bool operator >=(const l_real &,const interval &) noexcept;
398
400 friend bool operator ==(const idotprecision &,const l_real &) noexcept;
402 friend bool operator !=(const idotprecision &,const l_real &) noexcept;
404 friend bool operator <(const idotprecision &,const l_real &) noexcept;
406 friend bool operator >(const idotprecision &,const l_real &) noexcept;
408 friend bool operator <=(const idotprecision &,const l_real &) noexcept;
410 friend bool operator >=(const idotprecision &,const l_real &) noexcept;
411
413 friend bool operator ==(const l_real &,const idotprecision &) noexcept;
415 friend bool operator !=(const l_real &,const idotprecision &) noexcept;
417 friend bool operator <(const l_real &,const idotprecision &) noexcept;
419 friend bool operator >(const l_real &,const idotprecision &) noexcept;
421 friend bool operator <=(const l_real &,const idotprecision &) noexcept;
423 friend bool operator >=(const l_real &,const idotprecision &) noexcept;
424
425
427 friend bool operator!(const l_real& lr) noexcept;
428
429 // ---- functions ----
431 friend void accumulate(dotprecision&, const real&, const l_real&) noexcept;
433 friend void accumulate(dotprecision&, const l_real&, const real&) noexcept;
435 friend void accumulate(dotprecision&, const l_real&, const l_real&) noexcept;
436
438 friend void accumulate(idotprecision&,const real&, const l_real&) noexcept;
440 friend void accumulate(idotprecision&,const l_real&,const real&) noexcept;
442 friend void accumulate(idotprecision&,const l_real&, const l_real&) noexcept;
443
445 friend l_real abs (const l_real&) noexcept;
447 friend int sign (const l_real&) noexcept;
449 friend int StagPrec(const l_real&) noexcept;
451 friend l_real adjust(const l_real&) noexcept;
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 &) noexcept;
471 friend inline l_real Sup(const l_interval &) noexcept;
473 friend l_real mid(const l_interval &) noexcept;
475 friend inline bool zero_(const l_real &) noexcept; // Blomquist,27.11.02
476 private:
477 void _clear(int) noexcept; // filling a l_real number from element int p
478 // up to the end with zero.
479 void _akku_out(const dotprecision&) noexcept; // The dotprecision value is rounded to the
480 // activated l_real number in its own precision.
481 void _akku_out_up(const dotprecision&) noexcept; // The dotprecision value is rounded up to
482 // the activated l_real number in its own precision.
483 void _akku_out_down(const dotprecision&) noexcept; // The dotprecision value is rounded down
484 // to the activated l_real number in its own precision.
485 void _akku_add(dotprecision&) const noexcept; // adding the activated
486 // l_real number to the accumulator d.
487 void _akku_sub(dotprecision&) const noexcept; // subtracting the
488 // activated l_real number to the accumulator d of type dotprecision.
489 inline real& elem(int i) const noexcept { return data[i-1]; }
490};
491
492
493
494 // ---- Compare operators ----
495 bool operator ==(const l_real &,const l_real &) noexcept;
496 bool operator !=(const l_real &,const l_real &) noexcept;
497 bool operator <(const l_real &,const l_real &) noexcept;
498 bool operator >(const l_real &,const l_real &) noexcept;
499 bool operator <=(const l_real &,const l_real &) noexcept;
500 bool operator >=(const l_real &,const l_real &) noexcept;
501
502 bool operator ==(const real &,const l_real &) noexcept;
503 bool operator !=(const real &,const l_real &) noexcept;
504 bool operator <(const real &,const l_real &) noexcept;
505 bool operator >(const real &,const l_real &) noexcept;
506 bool operator <=(const real &,const l_real &) noexcept;
507 bool operator >=(const real &,const l_real &) noexcept;
508
509 bool operator ==(const l_real &,const real &) noexcept;
510 bool operator !=(const l_real &,const real &) noexcept;
511 bool operator <(const l_real &,const real &) noexcept;
512 bool operator >(const l_real &,const real &) noexcept;
513 bool operator <=(const l_real &,const real &) noexcept;
514 bool operator >=(const l_real &,const real &) noexcept;
515
516 bool operator ==(const dotprecision &,const l_real &) noexcept;
517 bool operator !=(const dotprecision &,const l_real &) noexcept;
518 bool operator <(const dotprecision &,const l_real &) noexcept;
519 bool operator >(const dotprecision &,const l_real &) noexcept;
520 bool operator <=(const dotprecision &,const l_real &) noexcept;
521 bool operator >=(const dotprecision &,const l_real &) noexcept;
522
523 bool operator ==(const l_real &,const dotprecision &) noexcept;
524 bool operator !=(const l_real &,const dotprecision &) noexcept;
525 bool operator <(const l_real &,const dotprecision &) noexcept;
526 bool operator >(const l_real &,const dotprecision &) noexcept;
527 bool operator <=(const l_real &,const dotprecision &) noexcept;
528 bool operator >=(const l_real &,const dotprecision &) noexcept;
529
530 bool operator ==(const interval &,const l_real &) noexcept;
531 bool operator !=(const interval &,const l_real &) noexcept;
532 bool operator <(const interval &,const l_real &) noexcept;
533 bool operator >(const interval &,const l_real &) noexcept;
534 bool operator <=(const interval &,const l_real &) noexcept;
535 bool operator >=(const interval &,const l_real &) noexcept;
536
537 bool operator ==(const l_real &,const interval &) noexcept;
538 bool operator !=(const l_real &,const interval &) noexcept;
539 bool operator <(const l_real &,const interval &) noexcept;
540 bool operator >(const l_real &,const interval &) noexcept;
541 bool operator <=(const l_real &,const interval &) noexcept;
542 bool operator >=(const l_real &,const interval &) noexcept;
543
544 bool operator ==(const idotprecision &,const l_real &) noexcept;
545 bool operator !=(const idotprecision &,const l_real &) noexcept;
546 bool operator <(const idotprecision &,const l_real &) noexcept;
547 bool operator >(const idotprecision &,const l_real &) noexcept;
548 bool operator <=(const idotprecision &,const l_real &) noexcept;
549 bool operator >=(const idotprecision &,const l_real &) noexcept;
550
551 bool operator ==(const l_real &,const idotprecision &) noexcept;
552 bool operator !=(const l_real &,const idotprecision &) noexcept;
553 bool operator <(const l_real &,const idotprecision &) noexcept;
554 bool operator >(const l_real &,const idotprecision &) noexcept;
555 bool operator <=(const l_real &,const idotprecision &) noexcept;
556 bool operator >=(const l_real &,const idotprecision &) noexcept;
557
558
559 bool operator!(const l_real& lr) noexcept;
560
561
562inline real _real(const l_real & a) noexcept { return real(a); }
563inline l_real _l_real(const real & a) noexcept { return l_real(a); }
564inline dotprecision _dotprecision(const l_real & a) noexcept
565 { return dotprecision(a); }
566inline l_real _l_real(const dotprecision & a) noexcept
567 { return l_real(a); }
568l_interval _unchecked_l_interval(const l_real &, const l_real &) noexcept;
569
571l_real rnd_up(const dotprecision&); // Blomquist, 20.11.2006;
573l_real rnd_down(const dotprecision&); // Blomquist, 20.11.2006;
574
576 inline l_real l_pow2n(const int n) noexcept
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
583inline void times2pown(l_real& lr, const int n) noexcept // 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
607inline void times2pown(l_real& lr, interval& z, const int n) noexcept
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
644inline void Times2pown(l_real& a, interval& z, int n) noexcept
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
695inline void Times2pown(l_real& a, const real& p) noexcept
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
744inline bool zero_(const l_real& lr) noexcept
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:
758l_real Ln2_l_real() noexcept; // ln(2)
760l_real Ln10_l_real() noexcept; // ln(10)
762l_real Ln10r_l_real() noexcept; // 1/ln(10)
764l_real Pid4_l_real() noexcept; // Pi/4
766l_real Sqrt2_l_real() noexcept; // sqrt(2)
768l_real Sqrt5_l_real() noexcept; // sqrt(5)
770l_real Sqrt7_l_real() noexcept; // sqrt(7)
772l_real Ln2r_l_real() noexcept; // 1/ln(2)
774l_real Pi_l_real() noexcept; // Pi
776l_real Pid2_l_real() noexcept; // Pi/2
778l_real Pi2_l_real() noexcept; // 2*Pi
780l_real Pid3_l_real() noexcept; // Pi/3
782l_real Pir_l_real() noexcept; // 1/Pi
784l_real Pi2r_l_real() noexcept; // 1/(2*Pi)
786l_real SqrtPi_l_real() noexcept; // sqrt(Pi)
788l_real Sqrt2Pi_l_real() noexcept; // sqrt(2*Pi)
790l_real SqrtPir_l_real() noexcept; // 1/sqrt(Pi)
792l_real Sqrt2Pir_l_real() noexcept; // 1/sqrt(2*Pi)
794l_real Pip2_l_real() noexcept; // Pi^2
796l_real Sqrt2r_l_real() noexcept; // 1/sqrt(2)
798l_real Sqrt3_l_real() noexcept; // sqrt(3)
800l_real Sqrt3d2_l_real() noexcept; // sqrt(3)/2
802l_real Sqrt3r_l_real() noexcept; // 1/sqrt(3)
804l_real LnPi_l_real() noexcept; // ln(Pi)
806l_real Ln2Pi_l_real() noexcept; // ln(2*Pi)
808l_real E_l_real() noexcept; // e = exp(1)
810l_real Er_l_real() noexcept; // 1/e
812l_real Ep2_l_real() noexcept; // e^2
814l_real Ep2r_l_real() noexcept; // 1/e^2
816l_real EpPi_l_real() noexcept; // e^Pi
818l_real Ep2Pi_l_real() noexcept; // e^(2*Pi)
820l_real EpPid2_l_real() noexcept; // e^(Pi/2)
822l_real EpPid4_l_real() noexcept; // e^(Pi/4)
824l_real EulerGa_l_real() noexcept; // EulerGamma
826l_real Catalan_l_real() noexcept; // Catalan
827
828} // namespace cxsc
829
830#endif // _CXSC_L_REAL_HPP_INCLUDED
831
The Data Type dotprecision.
Definition dot.hpp:112
dotprecision(void) noexcept
Constructor of class dotprecision.
Definition dot.cpp:62
dotprecision & operator=(const dotprecision &) noexcept
Implementation of standard assigning operator.
Definition dot.cpp:84
The Data Type idotprecision.
Definition idot.hpp:48
The Scalar Type interval.
Definition interval.hpp:55
The Multiple-Precision Data Type l_interval.
The Multiple-Precision Data Type l_real.
Definition l_real.hpp:78
friend std::istream & operator>>(std::istream &, l_real &) noexcept
Implementation of standard input method.
Definition l_real.cpp:317
friend l_real & operator-=(l_real &, const l_real &) noexcept
Implementation of standard algebraic subtraction and allocation operation.
Definition l_real.cpp:549
friend l_real rnd_down(const dotprecision &)
Rounds the argument down to the next l_real value.
Definition l_real.cpp:394
friend l_real abs(const l_real &) noexcept
The absolute value of a l_real value.
Definition l_real.cpp:670
friend bool operator!=(const l_real &, const l_real &) noexcept
Implementation of standard negated equality operation.
Definition l_real.cpp:579
real & operator[](int) const noexcept
Access to the single components used to store the long data type value.
Definition l_real.cpp:302
friend l_real adjust(const l_real &) noexcept
Sets the precision of a specific long datatype value.
Definition l_real.cpp:691
friend l_real & operator/=(l_real &, const l_real &) noexcept
Implementation of standard algebraic division and allocation operation.
Definition l_real.cpp:552
l_real(void) noexcept
Constructor of class l_real.
Definition l_real.cpp:174
friend bool operator!(const l_real &lr) noexcept
Implementation of standard negation operation.
Definition l_real.cpp:572
friend l_real & operator*=(l_real &, const l_real &) noexcept
Implementation of standard algebraic multiplication and allocation operation.
Definition l_real.cpp:551
friend bool operator>=(const l_real &, const l_real &) noexcept
Implementation of standard greater-or-equal-than operation.
Definition l_real.cpp:582
friend l_real mid(const l_interval &) noexcept
Returns the rounded middle of the l_interval.
friend real _l_real(const l_rmatrix_slice &) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
friend real _l_real(const l_rvector_slice &) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
friend l_real Sup(const l_interval &) noexcept
Returns the supremum of an l_interval.
friend l_real Inf(const l_interval &) noexcept
Returns the infimum of an l_interval.
friend int sign(const l_real &) noexcept
The sign of a l_real value.
Definition l_real.cpp:684
friend bool operator>(const l_real &, const l_real &) noexcept
Implementation of standard greater-than operation.
Definition l_real.cpp:581
friend l_real & operator+=(l_real &, const l_real &) noexcept
Implementation of standard algebraic addition and allocation operation.
Definition l_real.cpp:550
l_real(const l_rmatrix_slice &) noexcept
Constructor of class l_real.
friend bool zero_(const l_real &) noexcept
Checks if the argument is zero.
Definition l_real.hpp:744
friend int expo_sm(const l_real &)
Returns the minimum of the expo-function.
Definition l_real.cpp:725
friend real _l_real(const l_rvector &) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
friend l_real operator+(const l_real &lr1) noexcept
Implementation of standard algebraic positive sign operation.
Definition l_real.cpp:482
friend bool operator==(const l_real &, const l_real &) noexcept
Implementation of standard equality operation.
Definition l_real.cpp:554
friend void accumulate(dotprecision &, const real &, const l_real &) noexcept
The accurate scalar product of the last two arguments added to the value of the first argument.
Definition l_real.cpp:359
friend real _l_real(const l_rmatrix &) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
friend int StagPrec(const l_real &) noexcept
Returns the precision of the long datatype value.
Definition l_real.cpp:312
friend bool operator<(const l_real &, const l_real &) noexcept
Implementation of standard less-than operation.
Definition l_real.cpp:580
friend l_interval operator|(const l_real &, const l_real &) noexcept
Returns the convex hull of the arguments.
friend l_real rnd_up(const dotprecision &)
Rounds the argument up to the next l_real value.
Definition l_real.cpp:387
friend bool operator<=(const l_real &, const l_real &) noexcept
Implementation of standard less-or-equal-than operation.
Definition l_real.cpp:563
friend std::ostream & operator<<(std::ostream &, const l_real &) noexcept
Implementation of standard output method.
Definition l_real.cpp:325
friend l_real operator*(const l_real &, const l_real &) noexcept
Implementation of standard algebraic multiplication operation.
Definition l_real.cpp:508
friend l_real operator-(const l_real &lr1) noexcept
Implementation of standard algebraic negative sign operation.
Definition l_real.cpp:475
friend l_real operator/(const l_real &, const l_real &)
Implementation of standard algebraic division operation.
Definition l_real.cpp:517
friend int expo_gr(const l_real &)
Returns the maximum of the expo-function.
Definition l_real.cpp:744
The Multiple-Precision Data Type l_rmatrix_slice.
The Multiple-Precision Data Type l_rmatrix.
The Multiple-Precision Data Type l_rvector_slice.
The Multiple-Precision Data Type l_rvector.
Definition l_rvector.hpp:54
The Scalar Type real.
Definition real.hpp:114
real(void) noexcept
Constructor of class real.
Definition real.hpp:122
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition cdot.cpp:29
l_real Sqrt3r_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:252
l_real Ln2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:208
l_real Pid3_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:230
l_real E_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:258
l_real Er_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:260
l_real SqrtPir_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:240
l_real LnPi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:254
l_real l_pow2n(const int n) noexcept
Fast calculation of .
Definition l_real.hpp:576
l_real rnd_up(const dotprecision &a)
Rounds the argument up to the next l_real value.
Definition l_real.cpp:387
l_real Pip2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:244
l_real Ln10r_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:212
l_real Ln10_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:210
int expo_gr(const l_interval &x)
const real minreal
Smallest positive denormalized representable floating-point number.
Definition real.cpp:63
l_real Catalan_l_real() noexcept
Approximation of Catalan Numbers.
Definition l_rmath.cpp:276
l_real EpPid2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:270
l_real rnd_down(const dotprecision &a)
Rounds the argument down to the next l_real value.
Definition l_real.cpp:394
l_real SqrtPi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:236
l_real EulerGa_l_real() noexcept
Approximation of Euler Gamma.
Definition l_rmath.cpp:274
l_real Pi2r_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:234
l_real Ln2Pi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:256
l_real Sqrt2Pir_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:242
l_real EpPi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:266
l_real Sqrt2Pi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:238
l_real Sqrt3_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:248
l_real Ep2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:262
l_real Pir_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:232
l_real Sqrt5_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:218
l_real Ep2Pi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:268
l_real Sqrt2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:216
l_real Ep2r_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:264
void times2pown(cinterval &x, int n) noexcept
Fast multiplication of reference parameter [z] with .
Definition cimath.cpp:2059
l_real Sqrt2r_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:246
l_real Pi2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:228
l_real Sqrt7_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:220
l_real Sqrt3d2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:250
l_real Pi_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:224
l_real Pid4_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:214
l_real Pid2_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:226
l_real EpPid4_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:272
l_real Ln2r_l_real() noexcept
Approximation of .
Definition l_rmath.cpp:222
dotprecision _dotprecision(const real &d) noexcept
Definition dot.hpp:304