Skip to content

Commit f4f18a5

Browse files
committed
Allow further promotion to be disabled
1 parent 24e59fd commit f4f18a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/boost/math/special_functions/logistic_sigmoid.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
namespace boost {
1515
namespace math {
1616

17-
template <typename RealType, typename Policy>
17+
template <bool further_promotion = true, typename RealType, typename Policy>
1818
RealType logistic_sigmoid(RealType x, const Policy&)
1919
{
2020
BOOST_MATH_STD_USING
2121

22-
using promoted_real_type = typename policies::evaluation<RealType, Policy>::type;
22+
using promoted_real_type = std::conditional_t<further_promotion, typename policies::evaluation<RealType, Policy>::type, RealType>;
2323

2424
if(-x >= tools::log_max_value<RealType>())
2525
{
@@ -34,10 +34,10 @@ RealType logistic_sigmoid(RealType x, const Policy&)
3434
return res;
3535
}
3636

37-
template <typename RealType>
37+
template <bool further_promotion = true, typename RealType>
3838
RealType logistic_sigmoid(RealType x)
3939
{
40-
return logistic_sigmoid(x, policies::policy<>());
40+
return logistic_sigmoid<further_promotion>(x, policies::policy<>());
4141
}
4242

4343
} // namespace math

0 commit comments

Comments
 (0)