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&) noexcept; // 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&) noexcept; // 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&) noexcept; // Blomquist 05.08.03
47  real sqrtx2m1(const real&);
49  real sqrt1mx2(const real&);
50 
51 
53 inline real sin (const real&) noexcept; // Sin(x)
55  real sinpix_pi(const real& x); // sin(pi*x)/pi;
57 inline real cos (const real&) noexcept; // Cos(x)
59 inline real tan (const real&) noexcept; // Tan(x)
61 inline real cot (const real&) noexcept; // 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&) noexcept; // Exp(x)
75 inline real expm1 (const real&) noexcept; // Exp(x)-1
77  real expmx2 (const real&) noexcept; // 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&) noexcept; // Sinh(x)
95 inline real cosh (const real&) noexcept; // Cosh(x)
97  real acoshp1(const real& x) noexcept; // acosh(1+x)
99 inline real tanh (const real&) noexcept; // Tanh(x)
101 inline real coth (const real&) noexcept; // 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&) noexcept; // Sqrt(x^2+y^2)
128  real ln_sqrtx2y2(const real&, const real&);
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) noexcept;
140 int ceil(const real& x) noexcept;
142 int ifloor(const real& x) noexcept;
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 
cxsc::power
cinterval power(const cinterval &z, int n) noexcept
Calculates .
Definition: cimath.cpp:1941
cxsc::gamma
interval gamma(const interval &x)
The Gamma function.
Definition: imath.cpp:1465
cxsc::lnp1
cinterval lnp1(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:867
cxsc::asinh
cinterval asinh(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:2718
cxsc::sqrt1px2
cinterval sqrt1px2(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:1071
cxsc::coth
cinterval coth(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:578
cxsc::sin
cinterval sin(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:215
cxsc::cot
cinterval cot(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:538
cxsc::expmx2
interval expmx2(const interval &x)
Calculates .
Definition: imath.cpp:192
cxsc::log10
cinterval log10(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:903
cxsc::expx2
interval expx2(const interval &x)
Calculates .
Definition: imath.cpp:234
cxsc::sqrtm1
real sqrtm1(const real &)
Calculates .
Definition: rmath.inl:69
cxsc::tan
cinterval tan(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:393
cxsc::Cut26
real Cut26(const real &x)
Returns a real value, which corresponds with the first 26 mantissa bits of x.
Definition: rmath.cpp:520
cxsc::tanh
cinterval tanh(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:565
cxsc::sqrt
cinterval sqrt(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:1007
cxsc::ln
cinterval ln(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:851
cxsc::expx2m1
interval expx2m1(const interval &x)
Calculates .
Definition: imath.cpp:300
cxsc::log2
cinterval log2(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:898
cxsc::sqrtx2m1
cinterval sqrtx2m1(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:1109
cxsc::Cut25
real Cut25(const real &x)
Returns a real value, which corresponds with the first 25 mantissa bits of x.
Definition: rmath.cpp:504
cxsc::erfc
interval erfc(const interval &a)
The complementary Gauss error function .
Definition: imath.cpp:361
cxsc::acoshp1
interval acoshp1(const interval &x)
Calculates .
Definition: imath.cpp:617
cxsc::exp
cinterval exp(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:159
cxsc::acos
cinterval acos(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:2553
cxsc::Cut24
real Cut24(const real &x)
Returns a real value, which corresponds with the first 24 mantissa bits of x.
Definition: rmath.cpp:488
cxsc::Round
int Round(const real &x) noexcept
Rouding to the next integer; |x| < 2147483647.5.
Definition: rmath.cpp:536
cxsc::ceil
int ceil(const real &x) noexcept
Rounding to the smallest integer greater or equal x; -2147483649 < x <= 2147483647....
Definition: rmath.cpp:558
cxsc::cosh
cinterval cosh(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:223
cxsc::erf
interval erf(const interval &a)
The Gauss error function .
Definition: imath.cpp:354
cxsc::sinh
cinterval sinh(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:231
cxsc::ln_sqrtx2y2
interval ln_sqrtx2y2(const interval &x, const interval &y) noexcept
Calculates .
Definition: imath.cpp:581
cxsc::pow
cinterval pow(const cinterval &z, const interval &p) noexcept
Calculates .
Definition: cimath.cpp:2074
cxsc::sinpix_pi
interval sinpix_pi(const interval &x)
Calculates ;.
Definition: imath.cpp:655
cxsc::acoth
cinterval acoth(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:3330
cxsc
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
cxsc::sqrtp1m1
cinterval sqrtp1m1(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:1054
cxsc::ifloor
int ifloor(const real &x) noexcept
Rounding to the greates integer smaller or equal x; -2147483649 < x <= 2147483647....
Definition: rmath.cpp:570
cxsc::expm1
cinterval expm1(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:177
cxsc::atanh
cinterval atanh(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:3317
cxsc::cos
cinterval cos(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:207
cxsc::atan
cinterval atan(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:2938
cxsc::gammar
interval gammar(const interval &x)
The inverse Gamma function: 1/Gamma(x)
Definition: imath.cpp:1361
cxsc::acot
cinterval acot(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:3130
cxsc::sqrt1mx2
cinterval sqrt1mx2(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:1140
cxsc::acosh
cinterval acosh(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:2732
cxsc::sqr
cinterval sqr(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:3342
cxsc::sqrtx2y2
interval sqrtx2y2(const interval &x, const interval &y) noexcept
Calculates .
Definition: imath.cpp:80
cxsc::asin
cinterval asin(const cinterval &z) noexcept
Calculates .
Definition: cimath.cpp:2311