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

Add test set from issue

This commit is contained in:
Matt Borland
2024-05-30 08:50:26 +02:00
parent 76c68889ff
commit bcf0dbc7f8
2 changed files with 26 additions and 0 deletions

View File

@@ -173,6 +173,7 @@ test-suite special_fun :
[ run git_issue_1006.cpp ]
[ run git_issue_184.cpp ]
[ run git_issue_1137.cpp ]
[ run git_issue_1139.cpp ]
[ run special_functions_test.cpp ../../test/build//boost_unit_test_framework ]
[ run test_airy.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ]
[ run test_bessel_j.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ]

25
test/git_issue_1139.cpp Normal file
View File

@@ -0,0 +1,25 @@
// Copyright Matt Borland 2024.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See: https://github.com/boostorg/math/issues/1139
#include "math_unit_test.hpp"
#include <boost/math/tools/rational.hpp>
int main()
{
const double a[] = {1.0, 1.0, 1.0, 1.0, 1.0};
const double b[] = {1.0, 1.0, 1.0, 1.0, 1.0};
double x1 = 1e80;
double y1 = boost::math::tools::evaluate_rational(a, b, x1);
double x2 = -1e80;
double y2 = boost::math::tools::evaluate_rational(a, b, x2);
CHECK_ULP_CLOSE(y1, y2, 1);
return boost::math::test::report_errors();
}