C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
l_rmath.inl
00001 /*
00002 **  CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
00003 **
00004 **  Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
00005 **                          Universitaet Karlsruhe, Germany
00006 **            (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
00007 **                          Universitaet Wuppertal, Germany   
00008 **
00009 **  This library is free software; you can redistribute it and/or
00010 **  modify it under the terms of the GNU Library General Public
00011 **  License as published by the Free Software Foundation; either
00012 **  version 2 of the License, or (at your option) any later version.
00013 **
00014 **  This library is distributed in the hope that it will be useful,
00015 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 **  Library General Public License for more details.
00018 **
00019 **  You should have received a copy of the GNU Library General Public
00020 **  License along with this library; if not, write to the Free
00021 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 /* CVS $Id: l_rmath.inl,v 1.30 2014/01/30 17:23:46 cxsc Exp $ */
00025 
00026 #include "l_interval.hpp"
00027 #include "l_imath.hpp"
00028 
00029 namespace cxsc {
00030 
00031 inline l_real sqr(const l_real &x) throw() 
00032    { return (x*x); }
00033 inline l_real sqrt(const l_real & x,int n) 
00034    { return mid(sqrt(_l_interval(x),n)); }
00035 inline l_real sqrtp1m1(const l_real & x) throw()
00036    { return mid(sqrtp1m1(_l_interval(x))); }
00037 inline l_real sqrtx2m1(const l_real & x) throw() 
00038    { return mid(sqrtx2m1(_l_interval(x))); } // sqrt(x^2-1);
00039 inline l_real sqrt1mx2(const l_real& x) throw() 
00040    { return mid(sqrt1mx2(_l_interval(x)));}
00041 inline l_real ln_sqrtx2y2(const l_real& x, const l_real& y) throw()
00042    { return mid(ln_sqrtx2y2(_l_interval(x),_l_interval(y)));}
00043 inline l_real acoshp1(const l_real& x)
00044    { return mid(acoshp1(l_interval(x)));}
00045 
00046 inline l_real sin(const l_real & x) throw() 
00047    { return mid(sin(_l_interval(x))); }
00048 inline l_real cos(const l_real & x) throw() 
00049    { return mid(cos(_l_interval(x))); }
00050 inline l_real tan(const l_real & x) throw() 
00051    { return mid(tan(_l_interval(x))); }
00052 inline l_real cot(const l_real & x) throw() 
00053    { return mid(cot(_l_interval(x))); }
00054 
00055 inline l_real asin(const l_real & x) 
00056    { return mid(asin(_l_interval(x))); }
00057 inline l_real acos(const l_real & x)
00058    { return mid(acos(_l_interval(x))); }
00059 inline l_real atan(const l_real & x)
00060    { return mid(atan(_l_interval(x))); }
00061 inline l_real acot(const l_real & x)
00062    { return mid(acot(_l_interval(x))); }
00063 
00064 inline l_real exp(const l_real & x) throw() 
00065    { return mid(exp(_l_interval(x))); }
00066 inline l_real exp2(const l_real & x) throw() 
00067 { return mid(exp2(_l_interval(x))); }
00068 inline l_real exp10(const l_real & x) throw() 
00069 { return mid(exp10(_l_interval(x))); }
00070 inline l_real expm1(const l_real &x) throw()
00071    { return mid(expm1(l_interval(x))); }
00072 inline l_real expmx2(const l_real& x) throw() 
00073    { return mid(expmx2(l_interval(x)));}
00074 
00075 inline l_real ln(const l_real & x)
00076    { return mid(ln(_l_interval(x))); }
00077 inline l_real log2(const l_real & x)
00078 { return mid(log2(_l_interval(x))); }
00079 inline l_real log10(const l_real & x)
00080 { return mid(log10(_l_interval(x))); }
00081 
00082 inline l_real sinh(const l_real & x) throw() 
00083    { return mid(sinh(_l_interval(x))); }
00084 inline l_real cosh(const l_real & x) throw() 
00085    { return mid(cosh(_l_interval(x))); }
00086 inline l_real tanh(const l_real & x) throw() 
00087    { return mid(tanh(_l_interval(x))); }
00088 inline l_real coth(const l_real & x) throw() 
00089    { return mid(coth(_l_interval(x))); }
00090 
00091 inline l_real asinh(const l_real & x)
00092    { return mid(asinh(_l_interval(x))); }
00093 inline l_real acosh(const l_real & x)
00094    { return mid(acosh(_l_interval(x))); }
00095 inline l_real atanh(const l_real & x)
00096    { return mid(atanh(_l_interval(x))); }
00097 inline l_real acoth(const l_real & x)
00098    { return mid(acoth(_l_interval(x))); }
00099 
00100 inline l_real pow(const l_real & x,const l_real & expo) 
00101    { return mid(pow(_l_interval(x),_l_interval(expo))); }
00102 
00103 } // namespace cxsc
00104