diff --git a/include/boost/multiprecision/detail/default_ops.hpp b/include/boost/multiprecision/detail/default_ops.hpp index 57723ec9..59f80437 100644 --- a/include/boost/multiprecision/detail/default_ops.hpp +++ b/include/boost/multiprecision/detail/default_ops.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1500,6 +1501,10 @@ template typename enable_if_c::type eval_acosh(); template typename enable_if_c::type eval_atanh(); +template +typename enable_if_c::type eval_conj(); +template +typename enable_if_c::type eval_proj(); // // eval_logb and eval_scalbn simply assume base 2 and forward to @@ -1846,6 +1851,49 @@ inline typename boost::enable_if_c +inline typename boost::lazy_enable_if_c::value == number_kind_complex, component_type > >::type + abs(const number& v) +{ + return BOOST_MP_MOVE(boost::math::hypot(real(v), imag(v))); +} +template +inline typename boost::lazy_enable_if_c::result_type>::value == number_kind_complex, component_type::result_type> >::type + abs(const detail::expression& v) +{ + typedef typename detail::expression::result_type number_type; + return BOOST_MP_MOVE(abs(static_cast(v))); +} + +template +inline typename boost::lazy_enable_if_c::value == number_kind_complex, component_type > >::type +arg(const number& v) +{ + return BOOST_MP_MOVE(atan2(imag(v), real(v))); +} +template +inline typename boost::lazy_enable_if_c::result_type>::value == number_kind_complex, component_type::result_type> >::type +arg(const detail::expression& v) +{ + typedef typename detail::expression::result_type number_type; + return BOOST_MP_MOVE(arg(static_cast(v))); +} + +template +inline typename boost::lazy_enable_if_c::value == number_kind_complex, component_type > >::type +norm(const number& v) +{ + typename component_type >::type a(v.real()), b(v.imag()); + return BOOST_MP_MOVE(a * a + b * b); +} +template +inline typename boost::lazy_enable_if_c::result_type>::value == number_kind_complex, component_type::result_type> >::type +norm(const detail::expression& v) +{ + typedef typename detail::expression::result_type number_type; + return BOOST_MP_MOVE(norm(static_cast(v))); +} + } // namespace multiprecision namespace math { @@ -1876,34 +1924,40 @@ namespace multiprecision{ > c99_error_policy; template - inline multiprecision::number asinh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) + inline typename boost::enable_if_c::value != number_kind_complex, multiprecision::number >::type + asinh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { return boost::math::asinh(arg, c99_error_policy()); } template - inline typename multiprecision::detail::expression::result_type asinh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) + inline typename boost::enable_if_c::result_type>::value != number_kind_complex, typename multiprecision::detail::expression::result_type>::type + asinh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { typedef typename multiprecision::detail::expression::result_type value_type; return asinh(value_type(arg)); } template - inline multiprecision::number acosh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) + inline typename boost::enable_if_c::value != number_kind_complex, multiprecision::number >::type + acosh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { return boost::math::acosh(arg, c99_error_policy()); } template - inline typename multiprecision::detail::expression::result_type acosh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) + inline typename boost::enable_if_c::result_type>::value != number_kind_complex, typename multiprecision::detail::expression::result_type>::type + acosh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { typedef typename multiprecision::detail::expression::result_type value_type; return acosh(value_type(arg)); } template - inline multiprecision::number atanh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) + inline typename boost::enable_if_c::value != number_kind_complex, multiprecision::number >::type + atanh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number& arg) { return boost::math::atanh(arg, c99_error_policy()); } template - inline typename multiprecision::detail::expression::result_type atanh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) + inline typename boost::enable_if_c::result_type>::value != number_kind_complex, typename multiprecision::detail::expression::result_type>::type + atanh BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression& arg) { typedef typename multiprecision::detail::expression::result_type value_type; return atanh(value_type(arg)); @@ -2887,7 +2941,7 @@ func(const detail::expression& arg, const detail::expressio }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category::value == category),\ + is_compatible_arithmetic_type >::value && (number_category::value == category),\ detail::expression<\ detail::function\ , detail::BOOST_JOIN(category, BOOST_JOIN(func, _funct)) \ @@ -2910,7 +2964,7 @@ func(const number& arg, const Arithmetic& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category >::value == category),\ + is_compatible_arithmetic_type::result_type>::value && (number_category >::value == category),\ detail::expression<\ detail::function\ , detail::BOOST_JOIN(category, BOOST_JOIN(func, _funct)) >::type> \ @@ -2933,7 +2987,7 @@ func(const detail::expression& arg, const Arithmetic& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category::value == category),\ + is_compatible_arithmetic_type >::value && (number_category::value == category),\ detail::expression<\ detail::function\ , detail::BOOST_JOIN(category, BOOST_JOIN(func, _funct)) \ @@ -2956,7 +3010,7 @@ func(const Arithmetic& arg, const number& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category >::value == category),\ + is_compatible_arithmetic_type::result_type>::value && (number_category >::value == category),\ detail::expression<\ detail::function\ , detail::BOOST_JOIN(category, BOOST_JOIN(func, _funct)) >::type> \ @@ -2989,7 +3043,7 @@ func(const number& arg, const number& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category::value == category),\ + is_compatible_arithmetic_type >::value && (number_category::value == category),\ number \ >::type \ func(const number& arg, const Arithmetic& a)\ @@ -3002,7 +3056,7 @@ func(const number& arg, const Arithmetic& a)\ }\ template \ inline typename enable_if_c<\ - is_arithmetic::value && (number_category::value == category),\ + is_compatible_arithmetic_type>::value && (number_category::value == category),\ number \ >::type \ func(const Arithmetic& a, const number& arg)\ @@ -3102,10 +3156,11 @@ struct abs_funct } template -inline detail::expression< +inline typename boost::disable_if_c::result_type>::value == number_kind_complex, + detail::expression< detail::function , detail::abs_funct >::type> - , detail::expression > + , detail::expression > >::type abs(const detail::expression& arg) { return detail::expression< @@ -3118,10 +3173,11 @@ abs(const detail::expression& arg) ); } template -inline detail::expression< +inline typename disable_if_c::value == number_kind_complex, + detail::expression< detail::function , detail::abs_funct - , number > + , number > >::type abs(const number& arg) { return detail::expression< @@ -3134,7 +3190,7 @@ abs(const number& arg) ); } template -inline number +inline typename disable_if_c::value == number_kind_complex, number >::type abs(const number& arg) { number result; @@ -3213,6 +3269,8 @@ UNARY_OP_FUNCTOR(tanh, number_kind_complex) UNARY_OP_FUNCTOR(asinh, number_kind_complex) UNARY_OP_FUNCTOR(acosh, number_kind_complex) UNARY_OP_FUNCTOR(atanh, number_kind_complex) +UNARY_OP_FUNCTOR(conj, number_kind_complex) +UNARY_OP_FUNCTOR(proj, number_kind_complex) // // Integer functions: diff --git a/include/boost/multiprecision/detail/functions/pow.hpp b/include/boost/multiprecision/detail/functions/pow.hpp index 179e37f4..4158fcef 100644 --- a/include/boost/multiprecision/detail/functions/pow.hpp +++ b/include/boost/multiprecision/detail/functions/pow.hpp @@ -88,7 +88,7 @@ inline void pow_imp(T& result, const T& t, const U& p, const mpl::true_&) } // namespace detail template -inline typename enable_if >::type eval_pow(T& result, const T& t, const U& p) +inline typename enable_if_c::value>::type eval_pow(T& result, const T& t, const U& p) { detail::pow_imp(result, t, p, boost::is_signed()); } @@ -715,7 +715,7 @@ inline void eval_pow(T& result, const T& x, const T& a) } template -inline typename enable_if, void>::type eval_pow(T& result, const T& x, const A& a) +inline typename enable_if_c >::value && !is_integral::value, void>::type eval_pow(T& result, const T& x, const A& a) { // Note this one is restricted to float arguments since pow.hpp already has a version for // integer powers.... @@ -727,7 +727,7 @@ inline typename enable_if, void>::type eval_pow(T& result, } template -inline typename enable_if, void>::type eval_pow(T& result, const A& x, const T& a) +inline typename enable_if_c >::value, void>::type eval_pow(T& result, const A& x, const T& a) { typedef typename boost::multiprecision::detail::canonical::type canonical_type; typedef typename mpl::if_, T, canonical_type>::type cast_type; diff --git a/include/boost/multiprecision/mpc.hpp b/include/boost/multiprecision/mpc.hpp index 65d9c741..e686d15a 100644 --- a/include/boost/multiprecision/mpc.hpp +++ b/include/boost/multiprecision/mpc.hpp @@ -10,9 +10,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -884,6 +881,18 @@ inline void eval_atanh(mpc_float_backend& result, const mpc_float_back mpc_atanh(result.data(), arg.data(), GMP_RNDN); } +template +inline void eval_conj(mpc_float_backend& result, const mpc_float_backend& arg) +{ + mpc_conj(result.data(), arg.data(), GMP_RNDN); +} + +template +inline void eval_proj(mpc_float_backend& result, const mpc_float_backend& arg) +{ + mpc_proj(result.data(), arg.data(), GMP_RNDN); +} + template inline std::size_t hash_value(const mpc_float_backend& val) { @@ -955,6 +964,12 @@ inline typename component_type +number > polar(number, ExpressionTemplates>const& r, number, ExpressionTemplates> const& theta) +{ + number > result(number, ExpressionTemplates>(r * cos(theta)), number, ExpressionTemplates>(r * sin(theta))); + return result; +} } // namespace multiprecision diff --git a/include/boost/multiprecision/number.hpp b/include/boost/multiprecision/number.hpp index f676524e..33d95c85 100644 --- a/include/boost/multiprecision/number.hpp +++ b/include/boost/multiprecision/number.hpp @@ -1710,6 +1710,8 @@ private: BOOST_MP_FORCEINLINE BOOST_CONSTEXPR bool is_realy_self(const self_type& v)const BOOST_NOEXCEPT{ return &v == this; } static BOOST_MP_FORCEINLINE BOOST_CONSTEXPR const Backend& function_arg_value(const self_type& v) BOOST_NOEXCEPT { return v.backend(); } + template + static BOOST_MP_FORCEINLINE BOOST_CONSTEXPR const Other& function_arg_value(const number& v) BOOST_NOEXCEPT { return v.backend(); } template static BOOST_MP_FORCEINLINE BOOST_CONSTEXPR const V& function_arg_value(const V& v) BOOST_NOEXCEPT { return v; } template diff --git a/test/test_arithmetic.hpp b/test/test_arithmetic.hpp index 3b177445..0e1ed9aa 100644 --- a/test/test_arithmetic.hpp +++ b/test/test_arithmetic.hpp @@ -1974,6 +1974,52 @@ typename boost::enable_if_c::value BOOST_CHECK_EQUAL(real(a), 3); BOOST_CHECK_EQUAL(imag(a), 0); + a += r; + BOOST_CHECK_EQUAL(real(a), 6); + BOOST_CHECK_EQUAL(imag(a), 0); + + a *= r; + BOOST_CHECK_EQUAL(real(a), 18); + BOOST_CHECK_EQUAL(imag(a), 0); + + a = a / r; + BOOST_CHECK_EQUAL(real(a), 6); + BOOST_CHECK_EQUAL(imag(a), 0); + a = a - r; + BOOST_CHECK_EQUAL(real(a), 3); + BOOST_CHECK_EQUAL(imag(a), 0); + a = r + a; + BOOST_CHECK_EQUAL(real(a), 6); + BOOST_CHECK_EQUAL(imag(a), 0); + + r = abs(c); + BOOST_CHECK_CLOSE_FRACTION(real_type("3.60555127546398929311922126747049594625129657384524621271045305622716694829301044520461908201849071767351418202406"), r, tol); + r = arg(c); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.98279372324732906798571061101466601449687745363162855676142508831798807154979603538970653437281731110816513970201"), r, tol); + r = norm(c); + BOOST_CHECK_CLOSE_FRACTION(real_type(13), r, tol); + a = conj(c); + BOOST_CHECK_EQUAL(real(a), 2); + BOOST_CHECK_EQUAL(imag(a), -3); + a = proj(c); + BOOST_CHECK_EQUAL(real(a), 2); + BOOST_CHECK_EQUAL(imag(a), 3); + a = polar(real_type(3), real_type(-10)); + BOOST_CHECK_CLOSE_FRACTION(real_type("-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478"), imag(a), tol); + r = abs(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("3.60555127546398929311922126747049594625129657384524621271045305622716694829301044520461908201849071767351418202406"), r, tol); + r = arg(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.98279372324732906798571061101466601449687745363162855676142508831798807154979603538970653437281731110816513970201"), r, tol); + r = norm(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type(13), r, tol); + a = conj(c + 0); + BOOST_CHECK_EQUAL(real(a), 2); + BOOST_CHECK_EQUAL(imag(a), -3); + a = proj(c + 0); + BOOST_CHECK_EQUAL(real(a), 2); + BOOST_CHECK_EQUAL(imag(a), 3); + a = exp(c); BOOST_CHECK_CLOSE_FRACTION(real_type("-7.3151100949011025174865361510507893218698794489446322367845159660828327860599907104337742108443234172141249777"), real(a), tol); BOOST_CHECK_CLOSE_FRACTION(real_type("1.0427436562359044141015039404625521939183300604422348975424523449538886779880818796291971422701951470533151185"), imag(a), tol); @@ -1986,6 +2032,19 @@ typename boost::enable_if_c::value BOOST_CHECK_CLOSE_FRACTION(real_type("0.556971676153418384603252578971164215414864594193534135900595487498776545815097120403823727129449829836488977743"), real(a), tol); BOOST_CHECK_CLOSE_FRACTION(real_type("0.426821890855466638944275673291166123449562356934437957244904971730668088711719757900679614536803436424488603794"), imag(a), tol); + a = exp(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-7.3151100949011025174865361510507893218698794489446322367845159660828327860599907104337742108443234172141249777"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.0427436562359044141015039404625521939183300604422348975424523449538886779880818796291971422701951470533151185"), imag(a), tol); + + a = log(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.282474678730768368026743720782659302402633972380103558209522755331732333662205089699787331720244744384629096046"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.9827937232473290679857106110146660144968774536316285567614250883179880715497960353897065343728173111081651397020"), imag(a), tol); + + a = log10(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.556971676153418384603252578971164215414864594193534135900595487498776545815097120403823727129449829836488977743"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.426821890855466638944275673291166123449562356934437957244904971730668088711719757900679614536803436424488603794"), imag(a), tol); + + // Powers where one arg is an integer. b = Real(5, -2); a = pow(c, b); BOOST_CHECK_CLOSE_FRACTION(real_type("-3053.8558566606567369633610140423321260211388217942246293871310470377722279440084474789529228008638668934381183"), real(a), tol); @@ -1996,8 +2055,44 @@ typename boost::enable_if_c::value a = pow(3, c); BOOST_CHECK_CLOSE_FRACTION(real_type("-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338"), real(a), tol); BOOST_CHECK_CLOSE_FRACTION(real_type("-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118"), imag(a), tol); + a = pow(c + 0, b); + BOOST_CHECK_CLOSE_FRACTION(real_type("-3053.8558566606567369633610140423321260211388217942246293871310470377722279440084474789529228008638668934381183"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("3097.9975862915005132449772136982559285192410496951232473245540634244845290672745578327467396750607773968246915"), imag(a), tol); + a = pow(c + 0, 3); + BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol); + a = pow(3, c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118"), imag(a), tol); - //TODO powers where one arg is a real_type. + r = 3; + // Powers where one arg is a real_type. + a = pow(c, r); + BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol); + a = pow(r, c); + BOOST_CHECK_CLOSE_FRACTION(real_type("-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118"), imag(a), tol); + a = pow(c + 0, r); + BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol); + a = pow(r, c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118"), imag(a), tol); + + // Powers where one arg is an float. + a = pow(c, 3.0); + BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol); + a = pow(3.0, c); + BOOST_CHECK_CLOSE_FRACTION(real_type("-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118"), imag(a), tol); + a = pow(c + 0, 3.0); + BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol); + a = pow(3.0, c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118"), imag(a), tol); a = sqrt(c); BOOST_CHECK_CLOSE_FRACTION(real_type("1.674149228035540040448039300849051821674708677883920366727287836003399240343274891876712629708287692163156802065"), real(a), tol); @@ -2020,6 +2115,27 @@ typename boost::enable_if_c::value a = atan(c); BOOST_CHECK_CLOSE_FRACTION(real_type("1.409921049596575522530619384460420782588207051908724814771070766475530084440199227135813201495737846771570458568"), real(a), tol); BOOST_CHECK_CLOSE_FRACTION(real_type("0.2290726829685387662958818029420027678625253049770656169479919704951963414344907622560676377741902308144912055002"), imag(a), tol); + a = sqrt(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.674149228035540040448039300849051821674708677883920366727287836003399240343274891876712629708287692163156802065"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.8959774761298381247157337552900434410433241995549314932449006989874470582160955817053273057885402621549320588976"), imag(a), tol); + a = sin(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("9.154499146911429573467299544609832559158860568765182977899828142590020335321896403936690014669532606510294425039"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-4.168906959966564350754813058853754843573565604758055889965478710592666260138453299795649308385497563475115931624"), imag(a), tol); + a = cos(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-4.1896256909688072301325550196159737286219454041279210357407905058369727912162626993926269783331491034500484583"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-9.1092278937553365979791972627788621213326202389201695649104967309554222940748568716960841549279996556547993373"), imag(a), tol); + a = tan(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-0.0037640256415042482927512211303226908396306202016580864328644932511249097100916559688254811519914564480500042311"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.0032386273536098014463585978219272598077897241071003399272426939850671219193120708438426543945017427085738411"), imag(a), tol); + a = asin(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.5706527843210994007102838796856696501828032450960401365302732598209740064262509342420347149436326252483895113827"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132"), imag(a), tol); + a = acos(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.000143542473797218521037811954081791915781454591512773957199036332934196716853565071982697727425908742684531873"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132"), imag(a), tol); + a = atan(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.409921049596575522530619384460420782588207051908724814771070766475530084440199227135813201495737846771570458568"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.2290726829685387662958818029420027678625253049770656169479919704951963414344907622560676377741902308144912055002"), imag(a), tol); a = sinh(c); BOOST_CHECK_CLOSE_FRACTION(real_type("-3.5905645899857799520125654477948167931949136757293015099986213974178826801534614215227593814301490087307920223"), real(a), tol); @@ -2039,6 +2155,24 @@ typename boost::enable_if_c::value a = atanh(c); BOOST_CHECK_CLOSE_FRACTION(real_type("0.1469466662255297520474327851547159424423449403442452953891851939502023996823900422792744078835711416939934387775"), real(a), tol); BOOST_CHECK_CLOSE_FRACTION(real_type("1.338972522294493561124193575909144241084316172544492778582005751793809271060233646663717270678614587712809117131"), imag(a), tol); + a = sinh(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-3.5905645899857799520125654477948167931949136757293015099986213974178826801534614215227593814301490087307920223"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.53092108624851980526704009066067655967277345095149103008706855371803528753067068552935673000832252607835087747"), imag(a), tol); + a = cosh(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("-3.7245455049153225654739707032559725286749657732153307267858945686649501059065292889110148294141744084833329553"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.51182256998738460883446384980187563424555660949074386745538379123585339045741119409984041226187262097496424111"), imag(a), tol); + a = tanh(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.965385879022133124278480269394560685879729650005757773636908240066639772853967550095754361348005358178253777920"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("-0.00988437503832249372031403430350121097961813353467039031861010606115560355679254344335582852193041894874685555114"), imag(a), tol); + a = asinh(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.968637925793096291788665095245498189520731012682010573842811017352748255492485345887875752070076230641308014923"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.9646585044076027920454110594995323555197773725073316527132580297155508786089335572049608301897631767195194427315"), imag(a), tol); + a = acosh(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.000143542473797218521037811954081791915781454591512773957199036332934196716853565071982697727425908742684531873"), imag(a), tol); + a = atanh(c + 0); + BOOST_CHECK_CLOSE_FRACTION(real_type("0.1469466662255297520474327851547159424423449403442452953891851939502023996823900422792744078835711416939934387775"), real(a), tol); + BOOST_CHECK_CLOSE_FRACTION(real_type("1.338972522294493561124193575909144241084316172544492778582005751793809271060233646663717270678614587712809117131"), imag(a), tol); } template