// Generated: genmathfunc.cpp Jul 28 1998 17:29:02 #ifndef BZ_MATHFUNC_H #define BZ_MATHFUNC_H #ifndef BZ_APPLICS_H #error should be included via #endif #ifndef BZ_PRETTYPRINT_H #include #endif BZ_NAMESPACE(blitz) // abs(P_numtype1) Absolute value template class _bz_abs : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype1 T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(abs)(x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "abs("; a.prettyPrint(str,format); str += ")"; } }; // abs(long) template<> class _bz_abs : public OneOperandApplicativeTemplatesBase { public: typedef long T_numtype1; typedef long T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(labs)((long)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "labs("; a.prettyPrint(str,format); str += ")"; } }; // abs(float) template<> class _bz_abs : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(fabs)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "fabs("; a.prettyPrint(str,format); str += ")"; } }; // abs(double) template<> class _bz_abs : public OneOperandApplicativeTemplatesBase { public: typedef double T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(fabs)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "fabs("; a.prettyPrint(str,format); str += ")"; } }; // abs(long double) template<> class _bz_abs : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(fabs)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "fabs("; a.prettyPrint(str,format); str += ")"; } }; // acos(P_numtype1) Inverse cosine template class _bz_acos : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(acos)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acos("; a.prettyPrint(str,format); str += ")"; } }; // acos(float) template<> class _bz_acos : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(acos)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acos("; a.prettyPrint(str,format); str += ")"; } }; // acos(long double) template<> class _bz_acos : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(acos)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acos("; a.prettyPrint(str,format); str += ")"; } }; // acos(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_acos > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(acos)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acos("; a.prettyPrint(str,format); str += ")"; } }; #endif // acos(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_acos > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(acos)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acos("; a.prettyPrint(str,format); str += ")"; } }; #endif // acos(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_acos > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(acos)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acos("; a.prettyPrint(str,format); str += ")"; } }; #endif // acosh(P_numtype1) Inverse hyperbolic cosine #ifdef BZ_HAVE_IEEE_MATH template class _bz_acosh : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(acosh)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "acosh("; a.prettyPrint(str,format); str += ")"; } }; #endif // asin(P_numtype1) Inverse sine template class _bz_asin : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(asin)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asin("; a.prettyPrint(str,format); str += ")"; } }; // asin(float) template<> class _bz_asin : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(asin)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asin("; a.prettyPrint(str,format); str += ")"; } }; // asin(long double) template<> class _bz_asin : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(asin)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asin("; a.prettyPrint(str,format); str += ")"; } }; // asin(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_asin > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(asin)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asin("; a.prettyPrint(str,format); str += ")"; } }; #endif // asin(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_asin > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(asin)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asin("; a.prettyPrint(str,format); str += ")"; } }; #endif // asin(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_asin > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(asin)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asin("; a.prettyPrint(str,format); str += ")"; } }; #endif // asinh(P_numtype1) Inverse hyperbolic sine #ifdef BZ_HAVE_IEEE_MATH template class _bz_asinh : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(asinh)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "asinh("; a.prettyPrint(str,format); str += ")"; } }; #endif // atan(P_numtype1) Inverse tangent template class _bz_atan : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(atan)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atan("; a.prettyPrint(str,format); str += ")"; } }; // atan(float) template<> class _bz_atan : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(atan)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atan("; a.prettyPrint(str,format); str += ")"; } }; // atan(long double) template<> class _bz_atan : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(atan)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atan("; a.prettyPrint(str,format); str += ")"; } }; // atan(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_atan > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(atan)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atan("; a.prettyPrint(str,format); str += ")"; } }; #endif // atan(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_atan > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(atan)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atan("; a.prettyPrint(str,format); str += ")"; } }; #endif // atan(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_atan > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(atan)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atan("; a.prettyPrint(str,format); str += ")"; } }; #endif // atanh(P_numtype1) Inverse hyperbolic tangent #ifdef BZ_HAVE_IEEE_MATH template class _bz_atanh : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(atanh)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "atanh("; a.prettyPrint(str,format); str += ")"; } }; #endif // atan2(P_numtype1, P_numtype2) Inverse tangent template class _bz_atan2 : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(atan2)((double)x,(double)y); } }; // atan2(float, float) template<> class _bz_atan2 : public TwoOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype2; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(atan2)((float)x,(float)y); } }; // atan2(long double, long double) template<> class _bz_atan2 : public TwoOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype2; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(atan2)((long double)x,(long double)y); } }; // _class(P_numtype1) Classification of float-point value (FP_xxx) #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz__class : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef int T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(_class)(x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "_class("; a.prettyPrint(str,format); str += ")"; } }; #endif // cbrt(P_numtype1) Cube root #ifdef BZ_HAVE_IEEE_MATH template class _bz_cbrt : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cbrt)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cbrt("; a.prettyPrint(str,format); str += ")"; } }; #endif // ceil(P_numtype1) Ceiling template class _bz_ceil : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(ceil)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "ceil("; a.prettyPrint(str,format); str += ")"; } }; // ceil(float) template<> class _bz_ceil : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(ceil)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "ceil("; a.prettyPrint(str,format); str += ")"; } }; // ceil(long double) template<> class _bz_ceil : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(ceil)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "ceil("; a.prettyPrint(str,format); str += ")"; } }; // cos(P_numtype1) Cosine template class _bz_cos : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cos)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; } }; // cos(float) template<> class _bz_cos : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cos)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; } }; // cos(long double) template<> class _bz_cos : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cos)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; } }; // cos(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_cos > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cos)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; } }; #endif // cos(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_cos > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cos)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; } }; #endif // cos(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_cos > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cos)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; } }; #endif // copysign(P_numtype1, P_numtype2) #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_copysign : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(copysign)((double)x,(double)y); } }; #endif // cosh(P_numtype1) Hyperbolic cosine template class _bz_cosh : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cosh)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; } }; // cosh(float) template<> class _bz_cosh : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cosh)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; } }; // cosh(long double) template<> class _bz_cosh : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cosh)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; } }; // cosh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_cosh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cosh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; } }; #endif // cosh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_cosh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cosh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; } }; #endif // cosh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_cosh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cosh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; } }; #endif // drem(P_numtype1, P_numtype2) Remainder #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_drem : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(drem)((double)x,(double)y); } }; #endif // exp(P_numtype1) Exponential template class _bz_exp : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(exp)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; } }; // exp(float) template<> class _bz_exp : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(exp)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; } }; // exp(long double) template<> class _bz_exp : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(exp)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; } }; // exp(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_exp > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(exp)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; } }; #endif // exp(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_exp > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(exp)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; } }; #endif // exp(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_exp > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(exp)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; } }; #endif // expm1(P_numtype1) Exp(x)-1 #ifdef BZ_HAVE_IEEE_MATH template class _bz_expm1 : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(expm1)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "expm1("; a.prettyPrint(str,format); str += ")"; } }; #endif // erf(P_numtype1) Error function #ifdef BZ_HAVE_IEEE_MATH template class _bz_erf : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(erf)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "erf("; a.prettyPrint(str,format); str += ")"; } }; #endif // erfc(P_numtype1) Complementary error function #ifdef BZ_HAVE_IEEE_MATH template class _bz_erfc : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(erfc)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "erfc("; a.prettyPrint(str,format); str += ")"; } }; #endif // finite(P_numtype1) Nonzero if finite #ifdef BZ_HAVE_IEEE_MATH template class _bz_finite : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef int T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(finite)(x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "finite("; a.prettyPrint(str,format); str += ")"; } }; #endif // floor(P_numtype1) Floor function template class _bz_floor : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(floor)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "floor("; a.prettyPrint(str,format); str += ")"; } }; // floor(float) template<> class _bz_floor : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(floor)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "floor("; a.prettyPrint(str,format); str += ")"; } }; // floor(long double) template<> class _bz_floor : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(floor)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "floor("; a.prettyPrint(str,format); str += ")"; } }; // fmod(P_numtype1, P_numtype2) Modulo remainder #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_fmod : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(fmod)((double)x,(double)y); } }; #endif // hypot(P_numtype1, P_numtype2) sqrt(x*x+y*y) #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_hypot : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(hypot)((double)x,(double)y); } }; #endif // ilogb(P_numtype1) Integer unbiased exponent #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_ilogb : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef int T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(ilogb)(x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "ilogb("; a.prettyPrint(str,format); str += ")"; } }; #endif // isnan(P_numtype1) Nonzero if NaNS or NaNQ #ifdef BZ_HAVE_IEEE_MATH template class _bz_isnan : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef int T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(isnan)(x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "isnan("; a.prettyPrint(str,format); str += ")"; } }; #endif // itrunc(P_numtype1) Truncate and convert to integer #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_itrunc : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef int T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(itrunc)(x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "itrunc("; a.prettyPrint(str,format); str += ")"; } }; #endif // j0(P_numtype1) Bessel function first kind, order 0 #ifdef BZ_HAVE_IEEE_MATH template class _bz_j0 : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(j0)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "j0("; a.prettyPrint(str,format); str += ")"; } }; #endif // j1(P_numtype1) Bessel function first kind, order 1 #ifdef BZ_HAVE_IEEE_MATH template class _bz_j1 : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(j1)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "j1("; a.prettyPrint(str,format); str += ")"; } }; #endif // lgamma(P_numtype1) Log absolute gamma #ifdef BZ_HAVE_IEEE_MATH template class _bz_lgamma : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(lgamma)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "lgamma("; a.prettyPrint(str,format); str += ")"; } }; #endif // log(P_numtype1) Natural logarithm template class _bz_log : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log("; a.prettyPrint(str,format); str += ")"; } }; // log(float) template<> class _bz_log : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log("; a.prettyPrint(str,format); str += ")"; } }; // log(long double) template<> class _bz_log : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log("; a.prettyPrint(str,format); str += ")"; } }; // log(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_log > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(log)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log("; a.prettyPrint(str,format); str += ")"; } }; #endif // log(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_log > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(log)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log("; a.prettyPrint(str,format); str += ")"; } }; #endif // log(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_log > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(log)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log("; a.prettyPrint(str,format); str += ")"; } }; #endif // logb(P_numtype1) Unbiased exponent (IEEE) #ifdef BZ_HAVE_IEEE_MATH template class _bz_logb : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(logb)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "logb("; a.prettyPrint(str,format); str += ")"; } }; #endif // log1p(P_numtype1) Compute log(1 + x) #ifdef BZ_HAVE_IEEE_MATH template class _bz_log1p : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log1p)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log1p("; a.prettyPrint(str,format); str += ")"; } }; #endif // log10(P_numtype1) Logarithm base 10 template class _bz_log10 : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log10)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log10("; a.prettyPrint(str,format); str += ")"; } }; // log10(float) template<> class _bz_log10 : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log10)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log10("; a.prettyPrint(str,format); str += ")"; } }; // log10(long double) template<> class _bz_log10 : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(log10)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log10("; a.prettyPrint(str,format); str += ")"; } }; // log10(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_log10 > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(log10)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log10("; a.prettyPrint(str,format); str += ")"; } }; #endif // log10(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_log10 > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(log10)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log10("; a.prettyPrint(str,format); str += ")"; } }; #endif // log10(complex ) #ifdef BZ_HAVE_COMPLEX_MATH2 template<> class _bz_log10 > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(log10)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "log10("; a.prettyPrint(str,format); str += ")"; } }; #endif // nearest(P_numtype1) Nearest floating point integer #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_nearest : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(nearest)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "nearest("; a.prettyPrint(str,format); str += ")"; } }; #endif // nextafter(P_numtype1, P_numtype2) Next representable number after x towards y #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_nextafter : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(nextafter)((double)x,(double)y); } }; #endif template class _bz_negate : public OneOperandApplicativeTemplatesBase { public: typedef BZ_SIGNEDTYPE(P_numtype) T_numtype; static inline T_numtype apply(T_numtype x) { return -x; } }; // pow(P_numtype1, P_numtype2) Power template class _bz_pow : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(pow)((double)x,(double)y); } }; // pow(float, float) template<> class _bz_pow : public TwoOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype2; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(pow)((float)x,(float)y); } }; // pow(long double, long double) template<> class _bz_pow : public TwoOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype2; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(pow)((long double)x,(long double)y); } }; // pow(complex, complex) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_pow, complex > : public TwoOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype2; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_CMATHFN_SCOPE(pow)((complex)x,(complex)y); } }; #endif // pow(complex, complex) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_pow, complex > : public TwoOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype2; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_CMATHFN_SCOPE(pow)((complex)x,(complex)y); } }; #endif // pow(complex, complex) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_pow, complex > : public TwoOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype2; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_CMATHFN_SCOPE(pow)((complex)x,(complex)y); } }; #endif // remainder(P_numtype1, P_numtype2) Remainder #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_remainder : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(remainder)((double)x,(double)y); } }; #endif // rint(P_numtype1) Round to floating point integer #ifdef BZ_HAVE_IEEE_MATH template class _bz_rint : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(rint)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "rint("; a.prettyPrint(str,format); str += ")"; } }; #endif // rsqrt(P_numtype1) Reciprocal square root #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_rsqrt : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(rsqrt)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "rsqrt("; a.prettyPrint(str,format); str += ")"; } }; #endif // scalb(P_numtype1, P_numtype2) x * (2**y) #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_scalb : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(scalb)((double)x,(double)y); } }; #endif // sin(P_numtype1) Sine template class _bz_sin : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sin)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sin("; a.prettyPrint(str,format); str += ")"; } }; // sin(float) template<> class _bz_sin : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sin)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sin("; a.prettyPrint(str,format); str += ")"; } }; // sin(long double) template<> class _bz_sin : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sin)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sin("; a.prettyPrint(str,format); str += ")"; } }; // sin(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sin > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sin)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sin("; a.prettyPrint(str,format); str += ")"; } }; #endif // sin(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sin > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sin)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sin("; a.prettyPrint(str,format); str += ")"; } }; #endif // sin(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sin > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sin)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sin("; a.prettyPrint(str,format); str += ")"; } }; #endif // sinh(P_numtype1) Hyperbolic sine template class _bz_sinh : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sinh)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sinh("; a.prettyPrint(str,format); str += ")"; } }; // sinh(float) template<> class _bz_sinh : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sinh)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sinh("; a.prettyPrint(str,format); str += ")"; } }; // sinh(long double) template<> class _bz_sinh : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sinh)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sinh("; a.prettyPrint(str,format); str += ")"; } }; // sinh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sinh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sinh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sinh("; a.prettyPrint(str,format); str += ")"; } }; #endif // sinh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sinh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sinh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sinh("; a.prettyPrint(str,format); str += ")"; } }; #endif // sinh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sinh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sinh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sinh("; a.prettyPrint(str,format); str += ")"; } }; #endif template class _bz_sqr : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype T_numtype; static inline T_numtype apply(T_numtype x) { return x*x; } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqr("; a.prettyPrint(str,format); str += ")"; } }; // Specialization of _bz_sqr for complex template class _bz_sqr > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype; static inline T_numtype apply(T_numtype x) { T r = x.real(); T i = x.imag(); return T_numtype(r*r-i*i, 2*r*i); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqr("; a.prettyPrint(str,format); str += ")"; } }; // sqrt(P_numtype1) Square root template class _bz_sqrt : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sqrt)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqrt("; a.prettyPrint(str,format); str += ")"; } }; // sqrt(float) template<> class _bz_sqrt : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sqrt)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqrt("; a.prettyPrint(str,format); str += ")"; } }; // sqrt(long double) template<> class _bz_sqrt : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(sqrt)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqrt("; a.prettyPrint(str,format); str += ")"; } }; // sqrt(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sqrt > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sqrt)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqrt("; a.prettyPrint(str,format); str += ")"; } }; #endif // sqrt(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sqrt > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sqrt)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqrt("; a.prettyPrint(str,format); str += ")"; } }; #endif // sqrt(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_sqrt > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(sqrt)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "sqrt("; a.prettyPrint(str,format); str += ")"; } }; #endif // tan(P_numtype1) Tangent template class _bz_tan : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(tan)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tan("; a.prettyPrint(str,format); str += ")"; } }; // tan(float) template<> class _bz_tan : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(tan)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tan("; a.prettyPrint(str,format); str += ")"; } }; // tan(long double) template<> class _bz_tan : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(tan)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tan("; a.prettyPrint(str,format); str += ")"; } }; // tan(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_tan > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(tan)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tan("; a.prettyPrint(str,format); str += ")"; } }; #endif // tan(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_tan > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(tan)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tan("; a.prettyPrint(str,format); str += ")"; } }; #endif // tan(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_tan > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(tan)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tan("; a.prettyPrint(str,format); str += ")"; } }; #endif // tanh(P_numtype1) Hyperbolic tangent template class _bz_tanh : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(tanh)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tanh("; a.prettyPrint(str,format); str += ")"; } }; // tanh(float) template<> class _bz_tanh : public OneOperandApplicativeTemplatesBase { public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(tanh)((float)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tanh("; a.prettyPrint(str,format); str += ")"; } }; // tanh(long double) template<> class _bz_tanh : public OneOperandApplicativeTemplatesBase { public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(tanh)((long double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tanh("; a.prettyPrint(str,format); str += ")"; } }; // tanh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_tanh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(tanh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tanh("; a.prettyPrint(str,format); str += ")"; } }; #endif // tanh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_tanh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(tanh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tanh("; a.prettyPrint(str,format); str += ")"; } }; #endif // tanh(complex ) #ifdef BZ_HAVE_COMPLEX_MATH1 template<> class _bz_tanh > : public OneOperandApplicativeTemplatesBase { public: typedef complex T_numtype1; typedef complex T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(tanh)((complex )x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "tanh("; a.prettyPrint(str,format); str += ")"; } }; #endif // trunc(P_numtype1) Nearest floating integer in the direction of zero #ifdef BZ_HAVE_IEEE_MATH template class _bz_trunc : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(trunc)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "trunc("; a.prettyPrint(str,format); str += ")"; } }; #endif // uitrunc(P_numtype1) Truncate and convert to unsigned #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_uitrunc : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef unsigned T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(uitrunc)((unsigned)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "uitrunc("; a.prettyPrint(str,format); str += ")"; } }; #endif // unordered(P_numtype1, P_numtype2) True if a comparison of x and y would be unordered #ifdef BZ_HAVE_SYSTEM_V_MATH template class _bz_unordered : public TwoOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef int T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(unordered)(x,y); } }; #endif // y0(P_numtype1) Bessel function of the second kind, order zero #ifdef BZ_HAVE_IEEE_MATH template class _bz_y0 : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(y0)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "y0("; a.prettyPrint(str,format); str += ")"; } }; #endif // y1(P_numtype1) Bessel function of the second kind, order one #ifdef BZ_HAVE_IEEE_MATH template class _bz_y1 : public OneOperandApplicativeTemplatesBase { public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(y1)((double)x); } template static void prettyPrint(string& str, prettyPrintFormat& format, const T1& a) { str += "y1("; a.prettyPrint(str,format); str += ")"; } }; #endif BZ_NAMESPACE_END #endif // BZ_MATHFUNC_H