Skip to content

Commit c93b2f5

Browse files
committed
Update owens_t nan handling
1 parent fe69a5b commit c93b2f5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

stan/math/prim/fun/owens_t.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <stan/math/prim/meta.hpp>
55
#include <stan/math/prim/functor/apply_scalar_binary.hpp>
6-
#include <stan/math/prim/fun/boost_policy.hpp>
76
#include <boost/math/special_functions/owens_t.hpp>
87

98
namespace stan {
@@ -57,7 +56,10 @@ namespace math {
5756
* @return Owen's T function applied to the arguments.
5857
*/
5958
inline double owens_t(double h, double a) {
60-
return boost::math::owens_t(h, a, boost_policy_t<>());
59+
if (unlikely(std::isnan(h) || std::isnan(a))) {
60+
return std::numeric_limits<double>::quiet_NaN();
61+
}
62+
return boost::math::owens_t(h, a);
6163
}
6264

6365
/**

0 commit comments

Comments
 (0)