C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
rmath.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: rmath.hpp,v 1.36 2014/01/30 17:23:48 cxsc Exp $ */
25 
26 #ifndef _CXSC_RMATH_HPP_INCLUDED
27 #define _CXSC_RMATH_HPP_INCLUDED
28 
29 #include "real.hpp"
30 #include <dot.hpp> // Blomquist
31 
32 namespace cxsc {
33 
35 inline real sqr (const real&) throw(); // Sqr(x)
37 inline real sqrt (const real&); // Sqrt(x)
39 inline real sqrt (const real &, int); // Sqrt(x, n)
41  real sqrt1px2(const real&) throw(); // Sqrt(1+x^2); Blomquist 13.12.02
43 inline real sqrtm1 (const real&); // Sqrt(x+1)-1; ohne Fehlerabsch�zung!
45  real sqrtp1m1(const real&) throw(); // Blomquist 05.08.03
47  real sqrtx2m1(const real&);
49  real sqrt1mx2(const real&) throw(STD_FKT_OUT_OF_DEF);
50 
51 
53 inline real sin (const real&) throw(); // Sin(x)
55  real sinpix_pi(const real& x); // sin(pi*x)/pi;
57 inline real cos (const real&) throw(); // Cos(x)
59 inline real tan (const real&) throw(); // Tan(x)
61 inline real cot (const real&) throw(); // Cot(x)
62 
64 inline real asin (const real&); // ASin(x)
66 inline real acos (const real&); // ACos(x)
68 inline real atan (const real&); // ATan(x)
70 inline real acot (const real&); // ACot(x)
71 
73 inline real exp (const real&) throw(); // Exp(x)
75 inline real expm1 (const real&) throw(); // Exp(x)-1
77  real expmx2 (const real&) throw(); // Exp(-x^2)
79  real expx2 (const real& x); // e^{+x^2}
81  real expx2m1(const real& x); // e^{+x^2}-1
82 
84 inline real lnp1 (const real&); // Ln(1+x)
86 inline real ln (const real&); // Ln(x)
88 inline real log2 (const real&); // Log2(x)
90 inline real log10 (const real&); // Log10(x)
91 
93 inline real sinh (const real&) throw(); // Sinh(x)
95 inline real cosh (const real&) throw(); // Cosh(x)
97  real acoshp1(const real& x) throw(); // acosh(1+x)
99 inline real tanh (const real&) throw(); // Tanh(x)
101 inline real coth (const real&) throw(); // Coth(x)
102 
104 inline real asinh (const real&); // ASinh(x)
106 inline real acosh (const real&); // ACosh(x)
108 inline real atanh (const real&); // ATanh(x)
110 inline real acoth (const real&); // ACoth(x)
112 inline real erf (const real&); // error function
114 inline real erfc (const real&); // complementary error function
116  real gamma (const real& x); // Gamma(x)
118  real gammar(const real& x); // 1/Gamma(x)
119 
121 inline real pow (const real&, const real&); // Pow(x,y)
123 inline real power (const real&, const int); // Power(x,n)
124 
126  real sqrtx2y2(const real&, const real&) throw(); // Sqrt(x^2+y^2)
128  real ln_sqrtx2y2(const real&, const real&) throw(STD_FKT_OUT_OF_DEF);
129  // ln( sqrt(x^2+y^2) )
130 
132 real Cut24(const real&);
134 real Cut25(const real&);
136 real Cut26(const real&);
138 int Round(const real& x) throw();
140 int ceil(const real& x) throw();
142 int ifloor(const real& x) throw();
143 
144 extern "C" {
145  void r_lfsr(void); // Siehe real.hpp in real_ari...?!?!
146 }
147 
148 } // namespace cxsc
149 
150 #include "rmath.inl"
151 #endif // _CXSC_RMATH_HPP_INCLUDED
152 
cinterval sqrtx2m1(const cinterval &z)
Calculates .
Definition: cimath.cpp:1109
int Round(const real &x)
Rouding to the next integer; |x| < 2147483647.5.
Definition: rmath.cpp:536
interval expx2m1(const interval &x)
Calculates .
Definition: imath.cpp:300
cinterval sqrt1px2(const cinterval &z)
Calculates .
Definition: cimath.cpp:1071
cinterval log2(const cinterval &z)
Calculates .
Definition: cimath.cpp:898
interval expx2(const interval &x)
Calculates .
Definition: imath.cpp:234
interval sqrtx2y2(const interval &x, const interval &y)
Calculates .
Definition: imath.cpp:80
cinterval ln(const cinterval &z)
Calculates .
Definition: cimath.cpp:851
cinterval sin(const cinterval &z)
Calculates .
Definition: cimath.cpp:215
cinterval cot(const cinterval &z)
Calculates .
Definition: cimath.cpp:538
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
interval ln_sqrtx2y2(const interval &x, const interval &y)
Calculates .
Definition: imath.cpp:581
cinterval acot(const cinterval &z)
Calculates .
Definition: cimath.cpp:3130
int ceil(const real &x)
Rounding to the smallest integer greater or equal x; -2147483649 < x <= 2147483647.0;.
Definition: rmath.cpp:558
int ifloor(const real &x)
Rounding to the greates integer smaller or equal x; -2147483649 < x <= 2147483647.0;.
Definition: rmath.cpp:570
cinterval atan(const cinterval &z)
Calculates .
Definition: cimath.cpp:2938
cinterval acos(const cinterval &z)
Calculates .
Definition: cimath.cpp:2553
cinterval sqr(const cinterval &z)
Calculates .
Definition: cimath.cpp:3342
cinterval expm1(const cinterval &z)
Calculates .
Definition: cimath.cpp:177
interval gamma(const interval &x)
The Gamma function.
Definition: imath.cpp:1465
cinterval tanh(const cinterval &z)
Calculates .
Definition: cimath.cpp:565
cinterval asinh(const cinterval &z)
Calculates .
Definition: cimath.cpp:2718
cinterval log10(const cinterval &z)
Calculates .
Definition: cimath.cpp:903
interval sinpix_pi(const interval &x)
Calculates ;.
Definition: imath.cpp:655
cinterval sqrt1mx2(const cinterval &z)
Calculates .
Definition: cimath.cpp:1140
interval acoshp1(const interval &x)
Calculates .
Definition: imath.cpp:617
interval gammar(const interval &x)
The inverse Gamma function: 1/Gamma(x)
Definition: imath.cpp:1361
cinterval lnp1(const cinterval &z)
Calculates .
Definition: cimath.cpp:867
interval erfc(const interval &a)
The complementary Gauss error function .
Definition: imath.cpp:361
interval expmx2(const interval &x)
Calculates .
Definition: imath.cpp:192
cinterval sqrt(const cinterval &z)
Calculates .
Definition: cimath.cpp:1007
real Cut26(const real &x)
Returns a real value, which corresponds with the first 26 mantissa bits of x.
Definition: rmath.cpp:520
cinterval cos(const cinterval &z)
Calculates .
Definition: cimath.cpp:207
cinterval atanh(const cinterval &z)
Calculates .
Definition: cimath.cpp:3317
cinterval sqrtp1m1(const cinterval &z)
Calculates .
Definition: cimath.cpp:1054
cinterval exp(const cinterval &z)
Calculates .
Definition: cimath.cpp:159
real Cut24(const real &x)
Returns a real value, which corresponds with the first 24 mantissa bits of x.
Definition: rmath.cpp:488
cinterval cosh(const cinterval &z)
Calculates .
Definition: cimath.cpp:223
real sqrtm1(const real &)
Calculates .
Definition: rmath.inl:69
cinterval tan(const cinterval &z)
Calculates .
Definition: cimath.cpp:393
cinterval sinh(const cinterval &z)
Calculates .
Definition: cimath.cpp:231
real Cut25(const real &x)
Returns a real value, which corresponds with the first 25 mantissa bits of x.
Definition: rmath.cpp:504
cinterval asin(const cinterval &z)
Calculates .
Definition: cimath.cpp:2311
cinterval acoth(const cinterval &z)
Calculates .
Definition: cimath.cpp:3330
cinterval coth(const cinterval &z)
Calculates .
Definition: cimath.cpp:578
cinterval pow(const cinterval &z, const interval &p)
Calculates .
Definition: cimath.cpp:2074
cinterval power(const cinterval &z, int n)
Calculates .
Definition: cimath.cpp:1941
interval erf(const interval &a)
The Gauss error function .
Definition: imath.cpp:354
cinterval acosh(const cinterval &z)
Calculates .
Definition: cimath.cpp:2732