2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Add test case

This commit is contained in:
Matt Borland
2023-11-16 09:38:01 +01:00
parent 8c72a85ec6
commit de64f02ad3
2 changed files with 28 additions and 0 deletions

View File

@@ -896,6 +896,7 @@ test-suite distribution_tests :
[ run git_issue_800.cpp ../../test/build//boost_unit_test_framework ]
[ run git_issue_845.cpp ../../test/build//boost_unit_test_framework ]
[ run scipy_issue_14901.cpp ../../test/build//boost_unit_test_framework ]
[ run scipy_issue_14901_ncf.cpp ../../test/build//boost_unit_test_framework ]
[ run scipy_issue_15101.cpp ../../test/build//boost_unit_test_framework ]
[ run scipy_issue_17146.cpp ../../test/build//boost_unit_test_framework ]
[ run scipy_issue_17388.cpp ../../test/build//boost_unit_test_framework ]

View File

@@ -0,0 +1,27 @@
// Copyright Matt Borland, 2023
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See: https://github.com/scipy/scipy/issues/14901
#include <cfenv>
#include <boost/math/distributions/non_central_f.hpp>
#include "math_unit_test.hpp"
#pragma STDC FENV_ACCESS ON
int main()
{
auto ncf1 = boost::math::non_central_f(1, 1, 1);
const auto cdf1 = boost::math::cdf(ncf1, 2);
CHECK_ULP_CLOSE(cdf1, 1 - 0.5230393170884924, 20);
if (std::fetestexcept(FE_INVALID) || std::fetestexcept(FE_DIVBYZERO))
{
return 1;
}
return boost::math::test::report_errors();
}