26 #ifndef _CXSC_L_REAL_HPP_INCLUDED 27 #define _CXSC_L_REAL_HPP_INCLUDED 35 #include "interval.hpp" 43 #ifdef CXSC_USE_TLS_PREC 46 extern __declspec(thread)
int stagprec;
48 extern __thread
int stagprec;
106 explicit l_real(
int)
throw();
108 explicit l_real(
long)
throw();
114 explicit l_real(
const double &)
throw();
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);
145 friend INLINE
real _l_real(
const l_rvector &)
throw (ERROR_LRVECTOR_TYPE_CAST_OF_THICK_OBJ,ERROR_LRVECTOR_USE_OF_UNINITIALIZED_OBJ);
152 friend INLINE
real _l_real(
const l_rvector_slice &)
throw (ERROR_LRVECTOR_TYPE_CAST_OF_THICK_OBJ,ERROR_LRVECTOR_USE_OF_UNINITIALIZED_OBJ);
159 friend INLINE
real _l_real(
const l_rmatrix &)
throw (ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_LRMATRIX_USE_OF_UNINITIALIZED_OBJ);
166 friend INLINE
real _l_real(
const l_rmatrix_slice &)
throw (ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_LRMATRIX_USE_OF_UNINITIALIZED_OBJ);
477 void _clear(
int)
throw();
489 inline real& elem(
int i)
const throw() {
return data[i-1]; }
579 return l_real( comp(0.5,n+1) );
588 for (
int i=1; i<=k; i++)
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); }
617 real F = comp(0.5,n+1);
618 for (
int i=1; i<=k; i++)
623 if ( mt != mant(lr[i]) )
626 z += _interval(t) * F;
658 fac = n/1023; rest = n%1023;
659 for (
int k=1; k<=fac; k++)
673 fac = n/-1074; rest = n%-1074;
674 for (
int k=1; k<=fac; k++)
706 const int c1 = -1000000,
724 for (
int k=1; k<=fac; k++)
736 for (
int k=1; k<=fac; k++)
750 if (
sign(lr.elem(i))!=0) tmp =
false;
752 }
while(tmp && i <= p );
830 #endif // _CXSC_L_REAL_HPP_INCLUDED dotprecision _dotprecision(const real &d)
The Multiple-Precision Data Type l_rmatrix_slice.
l_real Ep2Pi_l_real()
Approximation of .
friend l_interval operator|(const l_real &, const l_real &)
Returns the convex hull of the arguments.
The Multiple-Precision Data Type l_interval.
friend bool operator==(const l_real &, const l_real &)
Implementation of standard equality operation.
l_real E_l_real()
Approximation of .
friend int sign(const l_real &)
The sign of a l_real value.
The Data Type idotprecision.
l_real Pip2_l_real()
Approximation of .
l_real EpPid2_l_real()
Approximation of .
The Multiple-Precision Data Type l_real.
The Data Type dotprecision.
l_real Pir_l_real()
Approximation of .
l_real Ln2_l_real()
Approximation of .
friend bool operator<=(const l_real &, const l_real &)
Implementation of standard less-or-equal-than operation.
l_real EpPi_l_real()
Approximation of .
The namespace cxsc, providing all functionality of the class library C-XSC.
l_real Ln10r_l_real()
Approximation of .
real & operator[](int) const
Access to the single components used to store the long data type value.
l_real l_pow2n(const int n)
Fast calculation of .
l_real Sqrt3r_l_real()
Approximation of .
The Scalar Type interval.
friend l_real abs(const l_real &)
The absolute value of a l_real value.
l_real EulerGa_l_real()
Approximation of Euler Gamma.
friend int StagPrec(const l_real &)
Returns the precision of the long datatype value.
l_real SqrtPi_l_real()
Approximation of .
friend l_real & operator/=(l_real &, const l_real &)
Implementation of standard algebraic division and allocation operation.
friend l_real & operator-=(l_real &, const l_real &)
Implementation of standard algebraic subtraction and allocation operation.
l_real Pi2r_l_real()
Approximation of .
l_real Ln10_l_real()
Approximation of .
l_real Sqrt3_l_real()
Approximation of .
l_real Sqrt3d2_l_real()
Approximation of .
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...
l_real & operator=(const l_real &)
Implementation of standard assigning operator.
l_real LnPi_l_real()
Approximation of .
friend bool operator!(const l_real &lr)
Implementation of standard negation operation.
l_real Ep2_l_real()
Approximation of .
friend l_real Inf(const l_interval &)
Returns the infimum of an l_interval.
dotprecision & operator=(const dotprecision &)
Implementation of standard assigning operator.
The Multiple-Precision Data Type l_rmatrix.
l_real SqrtPir_l_real()
Approximation of .
friend l_real operator/(const l_real &, const l_real &)
Implementation of standard algebraic division operation.
l_real Ln2r_l_real()
Approximation of .
l_real Ln2Pi_l_real()
Approximation of .
l_real Er_l_real()
Approximation of .
friend l_real operator+(const l_real &lr1)
Implementation of standard algebraic positive sign operation.
l_real Pi2_l_real()
Approximation of .
l_real Sqrt7_l_real()
Approximation of .
friend l_real rnd_down(const dotprecision &)
Rounds the argument down to the next l_real value.
friend bool zero_(const l_real &)
Checks if the argument is zero.
dotprecision(void)
Constructor of class dotprecision.
l_real Pid2_l_real()
Approximation of .
friend l_real operator*(const l_real &, const l_real &)
Implementation of standard algebraic multiplication operation.
l_real Pid3_l_real()
Approximation of .
friend bool operator>(const l_real &, const l_real &)
Implementation of standard greater-than operation.
friend l_real & operator*=(l_real &, const l_real &)
Implementation of standard algebraic multiplication and allocation operation.
l_real(void)
Constructor of class l_real.
friend l_real rnd_up(const dotprecision &)
Rounds the argument up to the next l_real value.
friend int expo_gr(const l_real &)
Returns the maximum of the expo-function.
real(void)
Constructor of class real.
friend l_real Sup(const l_interval &)
Returns the supremum of an l_interval.
l_real Pid4_l_real()
Approximation of .
friend l_real & operator+=(l_real &, const l_real &)
Implementation of standard algebraic addition and allocation operation.
The Multiple-Precision Data Type l_rvector.
friend bool operator!=(const l_real &, const l_real &)
Implementation of standard negated equality operation.
void times2pown(cinterval &x, int n)
Fast multiplication of reference parameter [z] with .
l_real Catalan_l_real()
Approximation of Catalan Numbers.
l_real Sqrt2_l_real()
Approximation of .
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.
friend std::ostream & operator<<(std::ostream &, const l_real &)
Implementation of standard output method.
const real minreal
Smallest positive denormalized representable floating-point number.
friend l_real mid(const l_interval &)
Returns the rounded middle of the l_interval.
l_real Sqrt2Pi_l_real()
Approximation of .
friend bool operator>=(const l_real &, const l_real &)
Implementation of standard greater-or-equal-than operation.
l_real Ep2r_l_real()
Approximation of .
l_real Sqrt5_l_real()
Approximation of .
friend std::istream & operator>>(std::istream &, l_real &)
Implementation of standard input method.
l_real EpPid4_l_real()
Approximation of .
The Multiple-Precision Data Type l_rvector_slice.
l_real Pi_l_real()
Approximation of .
friend l_real operator-(const l_real &lr1)
Implementation of standard algebraic negative sign operation.
friend int expo_sm(const l_real &)
Returns the minimum of the expo-function.
l_real Sqrt2r_l_real()
Approximation of .
friend bool operator<(const l_real &, const l_real &)
Implementation of standard less-than operation.
l_real Sqrt2Pir_l_real()
Approximation of .