diff --git a/.github/workflows/multiprecision.yml b/.github/workflows/multiprecision.yml index da9a9ebbd..10c1f8b92 100644 --- a/.github/workflows/multiprecision.yml +++ b/.github/workflows/multiprecision.yml @@ -30,7 +30,7 @@ jobs: matrix: compiler: [ g++-12, clang++-14 ] standard: [ c++14, c++17, c++20, c++2b ] - suite: [ github_ci_block_1, github_ci_block_2 ] + suite: [ specfun_mpfr, specfun_gmp, specfun_cpp_dec_float, specfun_cpp_bin_float, specfun_float128 ] steps: - uses: actions/checkout@v3 with: @@ -92,68 +92,6 @@ jobs: matrix: compiler: [ g++-10, g++-11, clang++-10, clang++-11 ] standard: [ c++14, c++17, c++2a ] - suite: [ github_ci_block_1, github_ci_block_2 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-9 g++-10 g++-11 clang-10 clang-11 libgmp-dev libmpfr-dev libtommath-dev libeigen3-dev libmpfi-dev libmpc-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config Info - run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES include=/usr/include/eigen3 - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - ubuntu-focal-slow-tests: - runs-on: ubuntu-20.04 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - standard: [ c++17, c++2a ] suite: [ specfun_mpfr, specfun_gmp, specfun_cpp_dec_float, specfun_cpp_bin_float, specfun_float128 ] steps: - uses: actions/checkout@v3 @@ -176,7 +114,7 @@ jobs: if: steps.retry1.outcome=='failure' run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - name: Install packages - run: sudo apt install g++-10 libgmp-dev libmpfr-dev libtommath-dev libeigen3-dev libmpfi-dev libmpc-dev + run: sudo apt install g++-9 g++-10 g++-11 clang-10 clang-11 libgmp-dev libmpfr-dev libtommath-dev libeigen3-dev libmpfi-dev libmpc-dev - name: Checkout main boost run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - name: Update tools/boostdep @@ -206,356 +144,4 @@ jobs: - name: b2 config run: cat bin.v2/config.log working-directory: ../boost-root/ - ubuntu-focal-standalone-tests: - runs-on: ubuntu-20.04 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - compiler: [ g++-11 ] - standard: [ c++14, c++17, c++20 ] - suite: [ standalone ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-11 libgmp-dev libmpfr-dev libtommath-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config Info - run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - ubuntu-focal-ASAN: - runs-on: ubuntu-20.04 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - standard: [ c++17 ] - suite: [ arithmetic_tests, functions_and_limits, conversions, cpp_int_tests, misc ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-10 libgmp-dev libmpfr-dev libtommath-dev libeigen3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config Info - run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 define=BOOST_CI_ASAN_BUILD define=BOOST_CI_SANITIZER_BUILD cxxflags=-fsanitize=address linkflags=-fsanitize=address toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - ubuntu-focal-UBSAN: - runs-on: ubuntu-20.04 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - standard: [ c++17 ] - suite: [ arithmetic_tests, functions_and_limits, misc ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-10 libgmp-dev libeigen3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config Info - run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 define=BOOST_CI_UBSAN_BUILD define=BOOST_CI_SANITIZER_BUILD cxxflags=-fsanitize=undefined linkflags=-fsanitize=undefined toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - windows_gcc: - runs-on: windows-2019 - defaults: - run: - shell: cmd - env: - ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }} - strategy: - fail-fast: false - matrix: - toolset: [ gcc ] - standard: [ 14, 17 ] - suite: [ github_ci_block_1, github_ci_block_2 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: bootstrap - working-directory: ../boost-root - - name: Generate headers - run: b2 headers - working-directory: ../boost-root - - name: Config Info - run: ..\..\..\b2 print_config_info print_math_info %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - windows_msvc_14_0: - runs-on: windows-2019 - defaults: - run: - shell: cmd - env: - ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }} - strategy: - fail-fast: false - matrix: - toolset: [ msvc-14.0 ] - standard: [ 14, 17 ] - suite: [ github_ci_block_1, github_ci_block_2 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: bootstrap - working-directory: ../boost-root - - name: Generate headers - run: b2 headers - working-directory: ../boost-root - - name: Config Info - run: ..\..\..\b2 print_config_info print_math_info %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - windows_msvc_14_2: - runs-on: windows-2019 - defaults: - run: - shell: cmd - env: - ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }} - strategy: - fail-fast: false - matrix: - toolset: [ msvc-14.2 ] - standard: [ 14, 17, 20 ] - suite: [ github_ci_block_1, github_ci_block_2 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: bootstrap - working-directory: ../boost-root - - name: Generate headers - run: b2 headers - working-directory: ../boost-root - - name: Config Info - run: ..\..\..\b2 print_config_info print_math_info %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} define=BOOST_MP_SF_CONCEPT_TESTS - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ - macos: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - toolset: [ clang ] - standard: [ 14, 17, 2a ] - suite: [ github_ci_block_1, github_ci_block_2 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/multiprecision - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py multiprecision - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Config Info - run: ../../../b2 print_config_info print_math_info toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 -j2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES - working-directory: ../boost-root/libs/multiprecision/test - - name: b2 config - run: cat bin.v2/config.log - working-directory: ../boost-root/ + \ No newline at end of file diff --git a/test/math/test_2F0.cpp b/test/math/test_2F0.cpp new file mode 100644 index 000000000..ce2180c89 --- /dev/null +++ b/test/math/test_2F0.cpp @@ -0,0 +1,67 @@ +// (C) Copyright John Maddock 2006. +// 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) + +#include "setup.hpp" +#include "libs/math/test/test_2F0.hpp" + +#include +#include + +void expected_results() +{ + // + // Define the max and mean errors expected for + // various compilers and platforms. + // + const char* largest_type; + + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + "Random non-integer a2.*", // test data group + ".*", 30000, 3000); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + "Integer.*", // test data group + ".*", 450, 100); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + "a1 = a2 \\+ 0\\.5", // test data group + ".*", 2500, 200); // test function + + // + // Finish off by printing out the compiler/stdlib/platform names, + // we do this to make it easier to mark up expected error rates. + // + std::cout << "Tests run with " << BOOST_COMPILER << ", " + << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; +} + +template +void test(T t, const char* s) +{ + test_spots(t, s); +} + +BOOST_AUTO_TEST_CASE( test_main ) +{ + using namespace boost::multiprecision; + expected_results(); + // + // Test at: + // 18 decimal digits: tests 80-bit long double approximations + // 30 decimal digits: tests 128-bit long double approximations + // 35 decimal digits: tests arbitrary precision code + // + ALL_TESTS +}