File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
include/boost/math/distributions Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -147,8 +147,9 @@ namespace boost { namespace math {
147
147
return result;
148
148
}
149
149
150
- RealType power = (x - location) / scale;
151
- return logistic_sigmoid (power, Policy ());
150
+ using promoted_real_type = typename policies::evaluation<RealType, Policy>::type;
151
+ promoted_real_type power = (static_cast <promoted_real_type>(x) - static_cast <promoted_real_type>(location)) / static_cast <promoted_real_type>(scale);
152
+ return logistic_sigmoid<false >(power, Policy ());
152
153
}
153
154
154
155
template <class RealType , class Policy >
@@ -248,8 +249,10 @@ namespace boost { namespace math {
248
249
{
249
250
return result;
250
251
}
251
- RealType power = (location - x) / scale;
252
- return logistic_sigmoid (power, Policy ());
252
+
253
+ using promoted_real_type = typename policies::evaluation<RealType, Policy>::type;
254
+ promoted_real_type power = (static_cast <promoted_real_type>(location) - static_cast <promoted_real_type>(x)) / static_cast <promoted_real_type>(scale);
255
+ return logistic_sigmoid<false >(power, Policy ());
253
256
}
254
257
255
258
template <class RealType , class Policy >
You can’t perform that action at this time.
0 commit comments