33 # include <itpp/config.h> 35 # include <itpp/config_msvc.h> 43 # define finite(x) _finite(x) 44 # define isfinite(x) _finite(x) 45 # define isnan(x) _isnan(x) 46 # define fpclass(x) _fpclass(x) 47 # define FP_NINF _FPCLASS_NINF 48 # define FP_PINF _FPCLASS_PINF 49 # define jn(a, b) _jn(a, b) 50 # define yn(a, b) _yn(a, b) 53 #endif // defined(_MSC_VER) 57 #if defined(HAVE_IEEEFP_H) 75 #ifndef HAVE_STD_ISINF 76 #if (HAVE_DECL_ISINF == 1) || defined(HAVE_ISINF) 77 inline int isinf(
double x) { return ::isinf(x); }
78 #elif defined(FPCLASS) 79 inline int isinf(
double x)
81 if (::fpclass(a) == FP_NINF)
return -1;
82 else if (::fpclass(a) == FP_PINF)
return 1;
86 inline int isinf(
double x)
88 if ((x == x) && ((x - x) != 0.0))
return (x < 0.0 ? -1 : 1);
91 #endif // #if (HAVE_DECL_ISINF == 1) || defined(HAVE_ISINF) 92 #endif // #ifndef HAVE_STD_ISINF 94 #ifndef HAVE_STD_ISNAN 95 #if (HAVE_DECL_ISNAN == 1) || defined(HAVE_ISNAN) 96 inline int isnan(
double x) { return ::isnan(x); }
98 inline int isnan(
double x) {
return ((x != x) ? 1 : 0); }
99 #endif // #if (HAVE_DECL_ISNAN == 1) || defined(HAVE_ISNAN) 100 #endif // #ifndef HAVE_STD_ISNAN 102 #ifndef HAVE_STD_ISFINITE 103 #if (HAVE_DECL_ISFINITE == 1) || defined(HAVE_ISFINITE) 104 inline int isfinite(
double x) { return ::isfinite(x); }
105 #elif defined(HAVE_FINITE) 106 inline int isfinite(
double x) { return ::finite(x); }
108 inline int isfinite(
double x)
110 return ((!std::isnan(x) && !std::isinf(x)) ? 1 : 0);
112 #endif // #if (HAVE_DECL_ISFINITE == 1) || defined(HAVE_ISFINITE) 113 #endif // #ifndef HAVE_STD_ISFINITE 119 double tgamma(
double x);
123 #if !defined(HAVE_LGAMMA) || (HAVE_DECL_SIGNGAM != 1) 124 double lgamma(
double x);
131 double cbrt(
double x);
137 inline double log1p(
double x) {
return std::log(1.0 + x); }
142 inline double log2(
double x)
145 static const double one_over_log2 = 1.0 /
std::log(2.0);
152 double expm1(
double x);
158 double erfc(
double x);
163 inline double erf(
double x) {
return (1.0 - ::
erfc(x)); }
169 double asinh(
double x);
174 double acosh(
double x);
179 double atanh(
double x);
185 double rint(
double x);
190 #define GCC_VERSION (__GNUC__ * 10000 \ 191 + __GNUC_MINOR__ * 100 \ 192 + __GNUC_PATCHLEVEL__)
vec atanh(const vec &x)
Inverse tan hyperbolic function.
vec asinh(const vec &x)
Inverse sine hyperbolic function.
vec log(const vec &x)
The natural logarithm of the elements.
vec log2(const vec &x)
log-2 of the elements
vec acosh(const vec &x)
Inverse cosine hyperbolic function.
std::complex< double > erf(const std::complex< double > &z)
Error function for complex argument.
vec erfc(const vec &x)
Complementary error function.