37#if defined(_GLUCAT_USE_QD)
38# include <qd/qd_real.h>
46#if defined(_GLUCAT_USE_QD) && defined(QD_API)
49# define _GLUCAT_QD_F(_T, _F) \
53 numeric_traits<_T>:: \
54 _F(const _T& val) -> _T \
62 isNaN(
const dd_real& val) ->
bool
63 {
return val.isnan(); }
70 isInf(
const dd_real& val) ->
bool
71 {
return val.isinf(); }
79 {
return val.isnan() || val.isinf(); }
86 to_int(
const dd_real& val) ->
int
87 { return ::to_int(val); }
95 { return ::to_double(val); }
102 fmod(
const dd_real& lhs,
const dd_real& rhs) -> dd_real
103 { return ::fmod(lhs, rhs); }
110 pow(
const dd_real& val,
int n) -> dd_real
112 if (val == dd_real(0))
121 auto result = dd_real(1);
144 {
return dd_real::_pi; }
152 {
return dd_real::_log2; }
155 _GLUCAT_QD_F(dd_real,
exp)
158 _GLUCAT_QD_F(dd_real,
log)
161 _GLUCAT_QD_F(dd_real,
cos)
164 _GLUCAT_QD_F(dd_real,
acos)
167 _GLUCAT_QD_F(dd_real,
cosh)
170 _GLUCAT_QD_F(dd_real,
sin)
173 _GLUCAT_QD_F(dd_real,
asin)
176 _GLUCAT_QD_F(dd_real,
sinh)
179 _GLUCAT_QD_F(dd_real,
tan)
182 _GLUCAT_QD_F(dd_real,
atan)
185 _GLUCAT_QD_F(dd_real,
tanh)
192 isNaN(
const qd_real& val) ->
bool
193 {
return val.isnan(); }
200 isInf(
const qd_real& val) ->
bool
201 {
return val.isinf(); }
209 {
return val.isnan() || val.isinf(); }
216 to_int(
const qd_real& val) ->
int
217 { return ::to_int(val); }
225 { return ::to_double(val); }
232 fmod(
const qd_real& lhs,
const qd_real& rhs) -> qd_real
233 { return ::fmod(lhs, rhs); }
240 pow(
const qd_real& val,
int n) -> qd_real
242 if (val == qd_real(0))
251 auto result = qd_real(1);
274 {
return qd_real::_pi; }
282 {
return qd_real::_log2; }
285 _GLUCAT_QD_F(qd_real,
exp)
288 _GLUCAT_QD_F(qd_real,
log)
291 _GLUCAT_QD_F(qd_real,
cos)
294 _GLUCAT_QD_F(qd_real,
acos)
297 _GLUCAT_QD_F(qd_real,
cosh)
300 _GLUCAT_QD_F(qd_real,
sin)
303 _GLUCAT_QD_F(qd_real,
asin)
306 _GLUCAT_QD_F(qd_real,
sinh)
309 _GLUCAT_QD_F(qd_real,
tan)
312 _GLUCAT_QD_F(qd_real,
atan)
315 _GLUCAT_QD_F(qd_real,
tanh)
static auto isNaN(const Scalar_T &val, bool_to_type< false >) -> bool
Smart isnan specialised for Scalar_T without quiet NaN.
static auto fmod(const Scalar_T &lhs, const Scalar_T &rhs) -> Scalar_T
Modulo function for scalar.
static auto isNaN_or_isInf(const Scalar_T &val) -> bool
Smart isnan or isinf.
static auto ln_2() -> Scalar_T
log(2)
static auto to_double(const Scalar_T &val) -> double
Cast to double.
static auto isInf(const Scalar_T &val, bool_to_type< false >) -> bool
Smart isinf specialised for Scalar_T without infinity.
static auto pi() -> Scalar_T
Pi.
static auto pow(const Scalar_T &val, int n) -> Scalar_T
Integer power.
static auto to_int(const Scalar_T &val) -> int
Cast to int.
auto exp(const framed_multi< Scalar_T, LO, HI, Tune_P > &val) -> const framed_multi< Scalar_T, LO, HI, Tune_P >
Exponential of multivector.
auto cosh(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Hyperbolic cosine of multivector.
auto tanh(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Hyperbolic tangent of multivector.
auto tan(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Tangent of multivector with specified complexifier.
auto sinh(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Hyperbolic sine of multivector.
auto sin(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Sine of multivector with specified complexifier.
auto atan(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse tangent of multivector with specified complexifier.
auto cos(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Cosine of multivector with specified complexifier.
auto log(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Natural logarithm of multivector with specified complexifier.
auto asin(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse sine of multivector with specified complexifier.
auto acos(const Multivector< Scalar_T, LO, HI, Tune_P > &val, const Multivector< Scalar_T, LO, HI, Tune_P > &i, const bool prechecked=false) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inverse cosine of multivector with specified complexifier.