From cb611145675e68b10e10ca61e5d15cc4268a2170 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 28 Dec 2022 18:31:05 +0000 Subject: [PATCH 01/20] Remove tests we don't need right now. !!!REVERT THIS COMMIT BEFORE MERGING!!! --- .drone.star | 38 ++-- .github/workflows/ci.yml | 475 --------------------------------------- 2 files changed, 19 insertions(+), 494 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.drone.star b/.drone.star index 96de1f90fe..837d8a9924 100644 --- a/.drone.star +++ b/.drone.star @@ -29,29 +29,29 @@ def main(ctx): # # Sanitizers: # - result.append(linux_cxx("Ubuntu g++-10 C++2a ASAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=address -fsanitize=address -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu g++-10 C++2a USAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=undefined -fsanitize=undefined -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu g++-10 C++2a TSAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=thread -fsanitize=thread -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu clang++-10 C++2a ISAN" + " " + suite, "clang++-10", packages="clang-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=integer -fsanitize=integer' }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-10 C++2a ASAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=address -fsanitize=address -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-10 C++2a USAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=undefined -fsanitize=undefined -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-10 C++2a TSAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=thread -fsanitize=thread -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu clang++-10 C++2a ISAN" + " " + suite, "clang++-10", packages="clang-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=integer -fsanitize=integer' }, globalenv=globalenv)) for suite in things_to_test: - for cxx in gnu_5_stds: - result.append(linux_cxx("Ubuntu g++-5 " + cxx + " " + suite, "g++-5", packages="g++-5", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - for cxx in gnu_6_stds: - result.append(linux_cxx("Ubuntu g++-6 " + cxx + " " + suite, "g++-6", packages="g++-6", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu g++-7 " + cxx + " " + suite, "g++-7", packages="g++-7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu g++-8 " + cxx + " " + suite, "g++-8", packages="g++-8", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu g++-9 " + cxx + " " + suite, "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - for cxx in clang_6_stds: - result.append(linux_cxx("Ubuntu clang++-6 " + cxx + " " + suite, "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu clang++-7 " + cxx + " " + suite, "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu clang++-8 " + cxx + " " + suite, "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #for cxx in gnu_5_stds: + #result.append(linux_cxx("Ubuntu g++-5 " + cxx + " " + suite, "g++-5", packages="g++-5", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #for cxx in gnu_6_stds: + #result.append(linux_cxx("Ubuntu g++-6 " + cxx + " " + suite, "g++-6", packages="g++-6", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-7 " + cxx + " " + suite, "g++-7", packages="g++-7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-8 " + cxx + " " + suite, "g++-8", packages="g++-8", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-9 " + cxx + " " + suite, "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #for cxx in clang_6_stds: + #result.append(linux_cxx("Ubuntu clang++-6 " + cxx + " " + suite, "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu clang++-7 " + cxx + " " + suite, "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu clang++-8 " + cxx + " " + suite, "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) for cxx in gnu_9_stds: - result.append(linux_cxx("Ubuntu g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #result.append(linux_cxx("Ubuntu g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) result.append(linux_cxx("Ubuntu g++-11 " + cxx + " " + suite, "g++-11", packages="g++-11", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-11', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - for cxx in clang_10_stds: - result.append(linux_cxx("Ubuntu clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + #for cxx in clang_10_stds: + #result.append(linux_cxx("Ubuntu clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) return result diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index cb62068c82..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,475 +0,0 @@ -# Copyright 2020 Evan Miller -# Copyright 2020 Matt Borland -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) - -name: CI -on: - push: - branches: - - master - - develop - pull_request: - release: - types: [published, created, edited] -jobs: - ubuntu-jammy: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-12, clang++-14 ] - standard: [ c++14, c++17, c++20 ] - 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++-12 clang-14 libgmp-dev libmpfr-dev libfftw3-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/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER - working-directory: ../boost-root/libs/math/test - ubuntu-focal-no-eh: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-9, g++-11, clang++-10 ] - standard: [ c++11, c++14, c++17, c++2a ] - 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++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-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/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=$TOOLSET no_eh_tests exception-handling=off rtti=off define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER - working-directory: ../boost-root/libs/math/test - macos: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - toolset: [ clang ] - standard: [ 11, 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: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER - working-directory: ../boost-root/libs/math/test - windows: - 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, msvc-14.2 ] - 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\math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ..\..\..\b2 config_info_travis_install %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Config info - run: config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/math/test - 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\math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ..\..\..\b2 config_info_travis_install %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Config info - run: config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/math/test - MSVC2022: - runs-on: windows-2022 - defaults: - run: - shell: cmd - env: - ARGS: address-model=64 cxxstd=${{ matrix.standard }} - strategy: - fail-fast: false - matrix: - 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\math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ..\..\..\b2 config_info_travis_install %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Config info - run: config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/math/test - cygwin: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - compiler: [ g++-11 ] - standard: [ c++17 ] - suite: [ github_ci_block_1, github_ci_block_2 ] - env: - TOOLSET: gcc - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - name: Install Cygwin - run: choco install -y cygwin - - name: Install Package Manager - run: choco install -y cyg-get - - name: Install Packages - run: cyg-get git gcc-core gcc-g++ python39 libgmp-devel libmpfr-devel libfftw3-devel - - name: Checkout main boost - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root' - - name: Update tools/boostdep - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && git submodule update --init tools/boostdep' - - name: Copy files - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && cp -r * ../boost-root/libs/math' - - name: Install deps - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && python tools/boostdep/depinst/depinst.py math' - - name: Bootstrap - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./bootstrap.sh' - - name: Generate headers - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./b2 headers' - - name: Config info install - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET' - - name: Config info - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ./config_info_travis' - - name: Test - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/math/test && ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER' - standalone-compile-tests-gcc: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - 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 libfftw3-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/math - working-directory: ../boost-root - - name: Run CMake - run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=g++-10 . - working-directory: ../boost-root/libs/math - - name: Run Compile Tests - run: make -j$((`nproc`+1)) - working-directory: ../boost-root/libs/math - standalone-compile-tests-clang: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ clang++-10 ] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - 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 clang-10 libgmp-dev libmpfr-dev libfftw3-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/math - working-directory: ../boost-root - - name: Run CMake - run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=clang++-10 . - working-directory: ../boost-root/libs/math - - name: Run Compile Tests - run: make -j$((`nproc`+1)) - working-directory: ../boost-root/libs/math - standalone-gcc: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - standard: [ c++14, c++17, c++20 ] - 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++-10 libgmp-dev libmpfr-dev libfftw3-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/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - 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 install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER define=BOOST_MATH_STANDALONE define=BOOST_MP_STANDALONE - working-directory: ../boost-root/libs/math/test From 4f03e96103e7eb26bbf7ed3118bcd5dd3e235357 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 28 Dec 2022 18:34:17 +0000 Subject: [PATCH 02/20] Add s390x testing to drone. --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 837d8a9924..5f3cf46d3c 100644 --- a/.drone.star +++ b/.drone.star @@ -49,7 +49,7 @@ def main(ctx): #result.append(linux_cxx("Ubuntu clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) for cxx in gnu_9_stds: #result.append(linux_cxx("Ubuntu g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - result.append(linux_cxx("Ubuntu g++-11 " + cxx + " " + suite, "g++-11", packages="g++-11", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-11', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++ s390s " + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) #for cxx in clang_10_stds: #result.append(linux_cxx("Ubuntu clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) From 23ebd63a65af33556d17060bfb45d9a3103b86bb Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 28 Dec 2022 18:37:09 +0000 Subject: [PATCH 03/20] Correct drone file. --- .drone.star | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.drone.star b/.drone.star index 5f3cf46d3c..dc92f4c813 100644 --- a/.drone.star +++ b/.drone.star @@ -35,23 +35,8 @@ def main(ctx): #result.append(linux_cxx("Ubuntu clang++-10 C++2a ISAN" + " " + suite, "clang++-10", packages="clang-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=integer -fsanitize=integer' }, globalenv=globalenv)) for suite in things_to_test: - #for cxx in gnu_5_stds: - #result.append(linux_cxx("Ubuntu g++-5 " + cxx + " " + suite, "g++-5", packages="g++-5", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #for cxx in gnu_6_stds: - #result.append(linux_cxx("Ubuntu g++-6 " + cxx + " " + suite, "g++-6", packages="g++-6", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu g++-7 " + cxx + " " + suite, "g++-7", packages="g++-7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu g++-8 " + cxx + " " + suite, "g++-8", packages="g++-8", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu g++-9 " + cxx + " " + suite, "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #for cxx in clang_6_stds: - #result.append(linux_cxx("Ubuntu clang++-6 " + cxx + " " + suite, "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu clang++-7 " + cxx + " " + suite, "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu clang++-8 " + cxx + " " + suite, "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) for cxx in gnu_9_stds: - #result.append(linux_cxx("Ubuntu g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) result.append(linux_cxx("Ubuntu g++ s390s " + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) - #for cxx in clang_10_stds: - #result.append(linux_cxx("Ubuntu clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) return result From ff4e5a4d56eee303fa3ca0a85f126c44dbb4bfbe Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 28 Dec 2022 18:38:19 +0000 Subject: [PATCH 04/20] Correct drone file (again) --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index dc92f4c813..62b24099a7 100644 --- a/.drone.star +++ b/.drone.star @@ -25,7 +25,7 @@ def main(ctx): result = [] - for suite in sanitizer_test: + #for suite in sanitizer_test: # # Sanitizers: # From 798a35f85144bfe769e6e879914a3564f54c8879 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 31 Dec 2022 18:34:53 +0000 Subject: [PATCH 05/20] Prevent complete cancellation in bessel_jy logic. --- include/boost/math/special_functions/detail/bessel_jy.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/boost/math/special_functions/detail/bessel_jy.hpp b/include/boost/math/special_functions/detail/bessel_jy.hpp index a43092603e..ca0aa7d2c2 100644 --- a/include/boost/math/special_functions/detail/bessel_jy.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy.hpp @@ -465,6 +465,13 @@ namespace boost { namespace math { for (k = n; k > 0; k--) // backward recurrence for J { next = 2 * (u + k) * current / x - prev; + // + // We can't allow next to completely cancel out or the subsequent logic breaks. + // Pretend that one bit did not cancel: + if (next == 0) + { + next = prev * tools::epsilon() / 2; + } prev = current; current = next; } From 6c51def0a783df5657478d0cb45cb59e2b3e5a3a Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 31 Dec 2022 18:35:21 +0000 Subject: [PATCH 06/20] Correct testing for 128-bit floats. --- test/test_bessel_i_prime.cpp | 2 +- test/test_bessel_j_prime.cpp | 2 +- test/test_bessel_y_prime.cpp | 2 +- test/test_beta.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_bessel_i_prime.cpp b/test/test_bessel_i_prime.cpp index 7786034c60..a4a54317df 100644 --- a/test/test_bessel_i_prime.cpp +++ b/test/test_bessel_i_prime.cpp @@ -109,7 +109,7 @@ void expected_results() ".*", // platform largest_type, // test type(s) ".*I'v.*Mathworld.*", // test data group - ".*", 4000, 2000); // test function + ".*", 4200, 2000); // test function add_expected_result( ".*", // compiler ".*", // stdlib diff --git a/test/test_bessel_j_prime.cpp b/test/test_bessel_j_prime.cpp index 1fb69c813c..d4641bbd48 100644 --- a/test/test_bessel_j_prime.cpp +++ b/test/test_bessel_j_prime.cpp @@ -270,7 +270,7 @@ void expected_results() ".*", // compiler ".*", // stdlib ".*", // platform - "float", // test type(s) + "float|double", // test type(s) "Bessel J': Mathworld Data", // test data group ".*", 30, 20); // test function // diff --git a/test/test_bessel_y_prime.cpp b/test/test_bessel_y_prime.cpp index f259f35636..8158abfbfb 100644 --- a/test/test_bessel_y_prime.cpp +++ b/test/test_bessel_y_prime.cpp @@ -284,7 +284,7 @@ void expected_results() ".*", // compiler ".*", // stdlib ".*", // platform - "float", // test type(s) + "float|double", // test type(s) "Y'v: Mathworld Data", // test data group ".*", 30, 20); // test function // diff --git a/test/test_beta.hpp b/test/test_beta.hpp index 217b80108b..5f201a2d38 100644 --- a/test/test_beta.hpp +++ b/test/test_beta.hpp @@ -98,7 +98,7 @@ void test_spots(T) BOOST_CHECK_CLOSE(::boost::math::beta(small, static_cast(4)), 1/small, tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), small), 1/small, tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), static_cast(20)), static_cast(0.00002823263692828910220214568040654997176736L), tolerance); - if (std::numeric_limits::digits < 100) + if ((std::numeric_limits::digits < 100) || (std::numeric_limits::digits == 0)) { // Inexact input, so disable for ultra precise long doubles: BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(0.0125L), static_cast(0.000023L)), static_cast(43558.24045647538375006349016083320744662L), tolerance * 2); From bea87c43a6383a884a44b97b67f3cadfb95e173a Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 1 Jan 2023 13:06:13 +0000 Subject: [PATCH 07/20] Make some more tests 128-bit long double safe. --- test/test_hankel.cpp | 2 +- test/test_ibeta_derivative.cpp | 10 ++++++++++ test/test_ibeta_inv.cpp | 27 ++++++++++++++++++++------- test/test_igamma.hpp | 2 +- test/test_lambert_w.cpp | 2 +- test/test_owens_t.cpp | 16 +++++++++++++++- 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/test/test_hankel.cpp b/test/test_hankel.cpp index 2eff6a3df9..f8bd173da8 100644 --- a/test/test_hankel.cpp +++ b/test/test_hankel.cpp @@ -57,7 +57,7 @@ void test_hankel(T, const char* name) {{ 4, 4, static_cast(0.281129064961360106322277160229942806897088617059328870629222L), static_cast(-0.488936768533842510615657398339913206218740182079627974737267L) }}, {{ 4, -4, static_cast(0.281129064961360106322277160229942806897088617059328870629222L), std::complex(static_cast(-0.488936768533842510615657398339913206218740182079627974737267L), static_cast(0.562258129922720212644554320459885613794177234118657741258443L)) }}, {{ -4, 4, static_cast(0.281129064961360106322277160229942806897088617059328870629222L), static_cast(-0.488936768533842510615657398339913206218740182079627974737267L) }}, - {{ -4, -4, static_cast(0.281129064961360106322277160229942806897088617059328870629222), std::complex(static_cast(-0.488936768533842510615657398339913206218740182079627974737267L), static_cast(0.562258129922720212644554320459885613794177234118657741258443L)) }}, + {{ -4, -4, static_cast(0.281129064961360106322277160229942806897088617059328870629222L), std::complex(static_cast(-0.488936768533842510615657398339913206218740182079627974737267L), static_cast(0.562258129922720212644554320459885613794177234118657741258443L)) }}, {{ 3, 3, static_cast(0.309062722255251643618260194946833149429135935993056794354475L), static_cast(-0.538541616105031618004703905338594463807957863604859251481262L) }}, {{ 3, -3, static_cast(-0.309062722255251643618260194946833149429135935993056794354475L), std::complex(static_cast(0.538541616105031618004703905338594463807957863604859251481262L), static_cast(-0.618125444510503287236520389893666298858271871986113588708949L)) }}, {{ -3, 3, static_cast(-0.309062722255251643618260194946833149429135935993056794354475L), static_cast(0.538541616105031618004703905338594463807957863604859251481262L) }}, diff --git a/test/test_ibeta_derivative.cpp b/test/test_ibeta_derivative.cpp index 3ad00f6673..25f7391998 100644 --- a/test/test_ibeta_derivative.cpp +++ b/test/test_ibeta_derivative.cpp @@ -83,6 +83,16 @@ void expected_results() largest_type, // test type(s) "[^|]*Large.*", // test data group ".*", 80000, 5000); // test function + if (std::numeric_limits::digits > 100) + { + add_expected_result( + "[^|]*", // compiler + "[^|]*", // stdlib + "[^|]*", // platform + largest_type, // test type(s) + "[^|]*Integer.*", // test data group + ".*", 4000000, 100000); // test function + } add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib diff --git a/test/test_ibeta_inv.cpp b/test/test_ibeta_inv.cpp index 7163efe780..6139763512 100644 --- a/test/test_ibeta_inv.cpp +++ b/test/test_ibeta_inv.cpp @@ -148,13 +148,26 @@ void expected_results() // // Catch all cases come last: // - add_expected_result( - ".*", // compiler - ".*", // stdlib - ".*", // platform - largest_type, // test type(s) - ".*", // test data group - ".*", 10000, 1000); // test function + if (std::numeric_limits::digits > 100) + { + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + largest_type, // test type(s) + ".*", // test data group + ".*", 50000, 3000); // test function + } + else + { + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + largest_type, // test type(s) + ".*", // test data group + ".*", 10000, 1000); // test function + } add_expected_result( ".*", // compiler ".*", // stdlib diff --git a/test/test_igamma.hpp b/test/test_igamma.hpp index 6cfd866712..b434f727ee 100644 --- a/test/test_igamma.hpp +++ b/test/test_igamma.hpp @@ -214,7 +214,7 @@ void test_spots(T) } if(std::numeric_limits::max_exponent >= 1024) { - BOOST_CHECK_CLOSE(::boost::math::tgamma(static_cast(170), static_cast(165)), static_cast(2.737338337642022829223832094019477918166996032112404370e304L), 3 * tolerance); + BOOST_CHECK_CLOSE(::boost::math::tgamma(static_cast(170), static_cast(165)), static_cast(2.737338337642022829223832094019477918166996032112404370e304L), (std::numeric_limits::digits > 100 ? 10 : 3) * tolerance); BOOST_CHECK_CLOSE(::boost::math::tgamma_lower(static_cast(170), static_cast(165)), static_cast(1.531729671362682445715419794880088619901822603944331733e304L), 3 * tolerance); BOOST_CHECK_CLOSE(::boost::math::tgamma(static_cast(170), static_cast(170)), static_cast(2.090991698081449410761040647015858316167077909285580375e304L), 10 * tolerance); BOOST_CHECK_CLOSE(::boost::math::tgamma_lower(static_cast(170), static_cast(170)), static_cast(2.178076310923255864178211241883708221901740726771155728e304L), 10 * tolerance); diff --git a/test/test_lambert_w.cpp b/test/test_lambert_w.cpp index 24a59e090d..6841f8d6fa 100644 --- a/test/test_lambert_w.cpp +++ b/test/test_lambert_w.cpp @@ -313,7 +313,7 @@ void wolfram_test_near_singularity() double tolerance = boost::math::tools::epsilon() * 5; if (std::numeric_limits::digits >= std::numeric_limits::digits) tolerance *= 1e5; - else if (std::numeric_limits::digits * 2 >= std::numeric_limits::digits) + else tolerance *= 5e4; double endpoint = -boost::math::constants::exp_minus_one(); for (unsigned i = 0; i < wolfram_test_near_singularity_data.size(); ++i) diff --git a/test/test_owens_t.cpp b/test/test_owens_t.cpp index 9ff7790d1d..8c33e77f07 100644 --- a/test/test_owens_t.cpp +++ b/test/test_owens_t.cpp @@ -88,7 +88,21 @@ void expected_results() // // Catch all cases come last: // - if(std::numeric_limits::digits > 60) + if(std::numeric_limits::digits > 100) + { + // + // Arbitrary precision versions run out steam (and series iterations) + // if we push them to too many digits: + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + largest_type, // test type(s) + ".*", // test data group + "owens_t", 10000000, 1000000); // test function + } + else if(std::numeric_limits::digits > 60) { add_expected_result( ".*", // compiler From df7872d28ecb63effe6807d2f548512409213282 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 1 Jan 2023 18:59:09 +0000 Subject: [PATCH 08/20] Make more tests 128-bit float safe. --- test/hypergeometric_test_data.ipp | 8 ++++---- test/test_logistic_dist.cpp | 2 +- test/test_nc_beta.cpp | 2 +- test/test_nc_f.cpp | 2 +- test/test_skew_normal.cpp | 2 ++ test/test_students_t.cpp | 6 ++++++ 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test/hypergeometric_test_data.ipp b/test/hypergeometric_test_data.ipp index 119237843d..fe7a325747 100644 --- a/test/hypergeometric_test_data.ipp +++ b/test/hypergeometric_test_data.ipp @@ -8,7 +8,7 @@ // absolute error, not a low relative error. // #define SC_(x) static_cast::type>(BOOST_JOIN(x, L)) - static const std::array, 398-105> hypergeometric_test_data = {{ + static const std::array, 398-108> hypergeometric_test_data = {{ //{{SC_(1.0),SC_(1.0),SC_(2.0),SC_(1.0),SC_(0.5),SC_(1.0),SC_(0.e-40)}}, {{SC_(5.0),SC_(4.0),SC_(6.0),SC_(3.0),SC_(0.6666666666666666666666666666666666666667),SC_(0.6666666666666666666666666666666666666667),SC_(0.3333333333333333333333333333333333333333)}}, //{{SC_(5.0),SC_(3.0),SC_(13.0),SC_(3.0),SC_(0.03496503496503496503496503496503496503497),SC_(1.0),SC_(0.e-40)}}, @@ -216,7 +216,7 @@ {{SC_(437.0),SC_(318.0),SC_(1209.0),SC_(134.0),SC_(0.00194550241359619551975486688720863879117),SC_(0.9959039509551882259961399094904303046884),SC_(0.0040960490448117740038600905095696953116)}}, //{{SC_(437.0),SC_(318.0),SC_(1209.0),SC_(297.0),SC_(3.099170124790288236133811018964458572526e-143),SC_(1.0),SC_(0.e-40)}}, //{{SC_(437.0),SC_(318.0),SC_(1209.0),SC_(315.0),SC_(8.745337833902361187545389118026512656014e-183),SC_(1.0),SC_(0.e-40)}}, - {{SC_(437.0),SC_(318.0),SC_(1209.0),SC_(184.0),SC_(1.307228949356826879223900266059585713681e-20),SC_(0.999999999999999999994796180432579251579),SC_(5.203819567420748421e-21)}}, + //{{SC_(437.0),SC_(318.0),SC_(1209.0),SC_(184.0),SC_(1.307228949356826879223900266059585713681e-20),SC_(0.999999999999999999994796180432579251579),SC_(5.203819567420748421e-21)}}, {{SC_(690.0),SC_(318.0),SC_(1209.0),SC_(37.0),SC_(3.320625863326094090483393792106638864492e-86),SC_(3.486813684143416952377418163000021290702e-86),SC_(1.0)}}, //{{SC_(690.0),SC_(318.0),SC_(1209.0),SC_(295.0),SC_(8.028270602773348094175158677072201916994e-59),SC_(1.0),SC_(0.e-40)}}, //{{SC_(690.0),SC_(318.0),SC_(1209.0),SC_(217.0),SC_(7.446847405448950069716275639243476085211e-7),SC_(0.9999992151368775059138538229355824721045),SC_(7.848631224940861461770644175278955e-7)}}, @@ -239,7 +239,7 @@ {{SC_(754.0),SC_(157.0),SC_(1209.0),SC_(48.0),SC_(3.336274865105840654390318803892947594077e-18),SC_(4.231951398640858500408212031832569592048e-18),SC_(0.999999999999999995768048601359141499592)}}, {{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(23.0),SC_(1.256916204055012846327346469934583088434e-86),SC_(1.280543104857283708622078393598734379004e-86),SC_(1.0)}}, {{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(11.0),SC_(1.746441258293646773567310499714837545838e-109),SC_(1.758881956444457902473727074497955667871e-109),SC_(1.0)}}, - {{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(156.0),SC_(3.911317894313098707233226403260859259024e-15),SC_(0.999999999999999914224101648539639734948),SC_(8.5775898351460360265052e-17)}}, + //{{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(156.0),SC_(3.911317894313098707233226403260859259024e-15),SC_(0.999999999999999914224101648539639734948),SC_(8.5775898351460360265052e-17)}}, {{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(49.0),SC_(2.903655345315729957508557380199650891209e-49),SC_(3.097571274031110857392766478316885711407e-49),SC_(1.0)}}, {{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(146.0),SC_(1.966253266445107381180160844299205213212e-6),SC_(0.9999992988002280865167638533917395359396),SC_(7.011997719134832361466082604640604e-7)}}, {{SC_(972.0),SC_(157.0),SC_(1209.0),SC_(120.0),SC_(0.03419666194773366390271416862729435096174),SC_(0.1100591220477970962195724476748588700464),SC_(0.8899408779522029037804275523251411299536)}}, @@ -302,7 +302,7 @@ {{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2775.0),SC_(2.980705983079855228190799398729048352087e-26),SC_(4.568054515761335768661592313440449747617e-26),SC_(0.999999999999999999999999954319454842387)}}, //{{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(3004.0),SC_(5.378089066435558496049070834586693555302e-26),SC_(0.999999999999999999999999966307286850134),SC_(3.3692713149866e-26)}}, {{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2769.0),SC_(4.575321018475226387137075375185371548035e-29),SC_(6.770307181230632452986350148326352876378e-29),SC_(0.999999999999999999999999999932296928188)}}, - {{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2964.0),SC_(1.832217460276038557251397001240443135099e-12),SC_(0.999999999997907478272135988382633698282),SC_(2.092521727864011617366301718e-12)}}, + //{{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2964.0),SC_(1.832217460276038557251397001240443135099e-12),SC_(0.999999999997907478272135988382633698282),SC_(2.092521727864011617366301718e-12)}}, {{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2863.0),SC_(0.003192814456943264796090309312301672830727),SC_(0.01529732399678425733294970091036265409296),SC_(0.984702676003215742667050299089637345907)}}, {{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2925.0),SC_(0.0001126567239667587485681805535995818729655),SC_(0.9997091506136263206825603745115894853285),SC_(0.0002908493863736793174396254884105146715)}}, //{{SC_(3215.0),SC_(4934.0),SC_(5494.0),SC_(2978.0),SC_(1.493072631611316664630886611666164517391e-16),SC_(0.999999999999999863933229779127230838208),SC_(1.36066770220872769161792e-16)}}, diff --git a/test/test_logistic_dist.cpp b/test/test_logistic_dist.cpp index 63c439ceac..cb6673315a 100644 --- a/test/test_logistic_dist.cpp +++ b/test/test_logistic_dist.cpp @@ -62,7 +62,7 @@ void test_spot(RealType location, RealType scale, RealType x, RealType p, RealTy complement(logistic_distribution(location,scale), q)), x, - 2 * tolerance); // % + 3 * tolerance); // % } } diff --git a/test/test_nc_beta.cpp b/test/test_nc_beta.cpp index 7d88f755c8..f35ac91df9 100644 --- a/test/test_nc_beta.cpp +++ b/test/test_nc_beta.cpp @@ -113,7 +113,7 @@ void expected_results() "[^|]*", // platform "real_concept", // test type(s) "[^|]*large[^|]*", // test data group - "[^|]*", 30000, 4000); // test function + "[^|]*", 30000, 5000); // test function add_expected_result( "[^|]*", // compiler "[^|]*", // stdlib diff --git a/test/test_nc_f.cpp b/test/test_nc_f.cpp index 3c36044155..b3123980ba 100644 --- a/test/test_nc_f.cpp +++ b/test/test_nc_f.cpp @@ -182,7 +182,7 @@ void test_spots(RealType) RealType(105), // F statistic RealType(0.99996207325249555786258005958906310L), // CDF RealType(0.000037926747504442137419940410936905407L), // Complement of CDF - RealType(8.9562292619539161551049126260104435e-7), // PDF + RealType(8.9562292619539161551049126260104435e-7L), // PDF RealType(tolerance * 10)); test_spot( RealType(100), // alpha diff --git a/test/test_skew_normal.cpp b/test/test_skew_normal.cpp index 2459ebb43f..2fb81978db 100644 --- a/test/test_skew_normal.cpp +++ b/test/test_skew_normal.cpp @@ -349,6 +349,8 @@ void test_spots(RealType) BOOST_MATH_STD_USING // ADL of std math lib names. // Test values from R = see skew_normal_drv.cpp which included the R code used. + // Note test values have limited precision. + if(boost::math::tools::digits() <= 64) { dist = skew_normal_distribution(static_cast(1.1l), static_cast(2.2l), static_cast(-3.3l)); diff --git a/test/test_students_t.cpp b/test/test_students_t.cpp index 72c6c37892..5d048096f9 100644 --- a/test/test_students_t.cpp +++ b/test/test_students_t.cpp @@ -268,6 +268,12 @@ void test_spots(RealType) // tolerance is 50 eps expressed as a percent: // tolerance = boost::math::tools::epsilon() * 5000; + // + // But higher error rates at 128 bit precision? + // + if (boost::math::tools::digits() > 100) + tolerance *= 100; + BOOST_CHECK_CLOSE(boost::math::quantile( students_t_distribution(2.00390625L), // degrees_of_freedom. static_cast(0.5625L)), // probability. From 275866cb95053dadca200ea619a4b202c047816b Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 2 Jan 2023 19:34:35 +0000 Subject: [PATCH 09/20] Fix some more 128-bit testing issues. --- test/test_bessel_airy_zeros.cpp | 12 +++++++-- test/test_bessel_i_prime.cpp | 2 +- test/test_bessel_y_prime.cpp | 2 +- test/test_beta.hpp | 2 +- test/test_ibeta_inv.cpp | 2 +- test/test_jacobi.hpp | 4 +-- test/test_owens_t.hpp | 48 ++++++++++++++++++++------------- 7 files changed, 45 insertions(+), 27 deletions(-) diff --git a/test/test_bessel_airy_zeros.cpp b/test/test_bessel_airy_zeros.cpp index 6296ac33d2..69132053dc 100644 --- a/test/test_bessel_airy_zeros.cpp +++ b/test/test_bessel_airy_zeros.cpp @@ -840,7 +840,11 @@ Calculated using cpp_dec_float_50 } BOOST_MATH_CHECK_THROW(airy_ai_zero(-1), std::domain_error); - BOOST_CHECK_CLOSE_FRACTION(airy_ai_zero((std::numeric_limits::max)()), -static_cast(4678579.33301973093739L), tolerance); + if (std::numeric_limits::digits && (std::numeric_limits::digits < 100)) + { + // Limited precision test value: + BOOST_CHECK_CLOSE_FRACTION(airy_ai_zero((std::numeric_limits::max)()), -static_cast(4678579.33301973093739L), tolerance); + } // Can't abuse with infinity because won't compile - no conversion. //if (std::numeric_limits::has_infinity) @@ -908,7 +912,11 @@ Calculated using cpp_dec_float_50 } BOOST_MATH_CHECK_THROW(airy_bi_zero(-1), std::domain_error); - BOOST_CHECK_CLOSE_FRACTION(airy_bi_zero((std::numeric_limits::max)()), -static_cast(4678579.33229351984573L), tolerance * 300); + if (std::numeric_limits::digits && (std::numeric_limits::digits < 100)) + { + // Limited precision test value: + BOOST_CHECK_CLOSE_FRACTION(airy_bi_zero((std::numeric_limits::max)()), -static_cast(4678579.33229351984573L), tolerance * 300); + } // Can't abuse with infinity because won't compile - no conversion. //if (std::numeric_limits::has_infinity) diff --git a/test/test_bessel_i_prime.cpp b/test/test_bessel_i_prime.cpp index a4a54317df..831cd7e0d6 100644 --- a/test/test_bessel_i_prime.cpp +++ b/test/test_bessel_i_prime.cpp @@ -137,7 +137,7 @@ void expected_results() ".*", // platform "real_concept", // test type(s) ".*I'v.*Mathworld.*", // test data group - ".*", 4000, 2000); // test function + ".*", 4500, 2000); // test function add_expected_result( ".*", // compiler ".*", // stdlib diff --git a/test/test_bessel_y_prime.cpp b/test/test_bessel_y_prime.cpp index 8158abfbfb..20b4abbeee 100644 --- a/test/test_bessel_y_prime.cpp +++ b/test/test_bessel_y_prime.cpp @@ -118,7 +118,7 @@ void expected_results() "linux", // platform "double", // test type(s) ".*", // test data group - ".*", 30, 2); // test function + ".*", 30, 20); // test function add_expected_result( ".*", // compiler ".*", // stdlib diff --git a/test/test_beta.hpp b/test/test_beta.hpp index 5f201a2d38..b7ec01769d 100644 --- a/test/test_beta.hpp +++ b/test/test_beta.hpp @@ -98,7 +98,7 @@ void test_spots(T) BOOST_CHECK_CLOSE(::boost::math::beta(small, static_cast(4)), 1/small, tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), small), 1/small, tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), static_cast(20)), static_cast(0.00002823263692828910220214568040654997176736L), tolerance); - if ((std::numeric_limits::digits < 100) || (std::numeric_limits::digits == 0)) + if ((std::numeric_limits::digits < 100) && (std::numeric_limits::digits != 0)) { // Inexact input, so disable for ultra precise long doubles: BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(0.0125L), static_cast(0.000023L)), static_cast(43558.24045647538375006349016083320744662L), tolerance * 2); diff --git a/test/test_ibeta_inv.cpp b/test/test_ibeta_inv.cpp index 6139763512..218c1625e8 100644 --- a/test/test_ibeta_inv.cpp +++ b/test/test_ibeta_inv.cpp @@ -156,7 +156,7 @@ void expected_results() ".*", // platform largest_type, // test type(s) ".*", // test data group - ".*", 50000, 3000); // test function + ".*", 200000, 5000); // test function } else { diff --git a/test/test_jacobi.hpp b/test/test_jacobi.hpp index dd0ed60e96..186def46b6 100644 --- a/test/test_jacobi.hpp +++ b/test/test_jacobi.hpp @@ -99,8 +99,8 @@ void test_spots(T, const char* type_name) {{ SC_(-1.25), ldexp(T(1), -25), SC_(-0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }}, {{ SC_(25.0), ldexp(T(1), -25), SC_(-0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }}, {{ SC_(-25.0), ldexp(T(1), -25), SC_(0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }}, - {{ ldexp(T(1), -25), SC_(0.5), SC_(2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }}, - {{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }}, + {{ ldexp(T(1), -25), SC_(0.5), SC_(2.9802322387695306985462582979816394722771323981194501394601e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }}, + {{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.9802322387695306985462582979816394722771323981194501394601e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }}, {{ SC_(0.25), SC_(0.5), SC_(0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }}, {{ SC_(-0.25), SC_(0.5), SC_(-0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }}, {{ SC_(1.25), SC_(0.5), SC_(0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }}, diff --git a/test/test_owens_t.hpp b/test/test_owens_t.hpp index d16ebd3868..bfebbd7af9 100644 --- a/test/test_owens_t.hpp +++ b/test/test_owens_t.hpp @@ -41,27 +41,30 @@ void test_spots(RealType) using ::boost::math::normal_distribution; BOOST_MATH_STD_USING // ADL of std names. + if(std::numeric_limits::digits && (std::numeric_limits::digits < 100)) + { + // Checks of six sub-methods T1 to T6. BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.0625L), static_cast(0.25L)), static_cast(3.89119302347013668966224771378e-2L), tolerance); // T1 - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(6.5L), static_cast(0.4375L)), static_cast(2.00057730485083154100907167685E-11L), tolerance); // T2 - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(7L), static_cast(0.96875L)), static_cast(6.39906271938986853083219914429E-13L), tolerance); // T3 - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(4.78125L), static_cast(0.0625L)), static_cast(1.06329748046874638058307112826E-7L), tolerance); // T4 - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(2.L), static_cast(0.5L)), static_cast(8.62507798552150713113488319155E-3L), tolerance); // T5 - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(1.L), static_cast(0.9999975L)), static_cast(6.67418089782285927715589822405E-2L), tolerance); // T6 - //BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(L), static_cast(L)), static_cast(L), tolerance); - - // BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(L), static_cast(L)), static_cast(L), tolerance); - - // Spots values using Mathematica - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(6.5L), static_cast(0.4375L)), static_cast(2.00057730485083154100907167684918851101649922551817956120806662022118024594547E-11L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.4375L), static_cast(6.5L)), static_cast(0.16540130125449396247498691826626273249659241838438244251206819782787761751256L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(7.L), static_cast(0.96875L)), static_cast(6.39906271938986853083219914428916013764797190941459233223182225724846022843930e-13L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.96875L), static_cast(7.L)), static_cast(0.08316748474602973770533230453272140919966614259525787470390475393923633179072L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(4.78125L), static_cast(0.0625L)), static_cast(1.06329748046874638058307112826015825291136503488102191050906959246644942646701e-7L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.0625L), static_cast(4.78125L)), static_cast(0.21571185819897989857261253680409017017649352928888660746045361855686569265171L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(2.L), static_cast(0.5L)), static_cast(0.00862507798552150713113488319154637187875641190390854291100809449487812876461L), tolerance); - BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.5L), static_cast(2L)), static_cast(0.14158060365397839346662819588111542648867283386549027383784843786494855594607L), tolerance); - + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(6.5L), static_cast(0.4375L)), static_cast(2.00057730485083154100907167685E-11L), tolerance); // T2 + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(7L), static_cast(0.96875L)), static_cast(6.39906271938986853083219914429E-13L), tolerance); // T3 + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(4.78125L), static_cast(0.0625L)), static_cast(1.06329748046874638058307112826E-7L), tolerance); // T4 + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(2.L), static_cast(0.5L)), static_cast(8.62507798552150713113488319155E-3L), tolerance); // T5 + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(1.L), static_cast(0.9999975L)), static_cast(6.67418089782285927715589822405E-2L), tolerance); // T6 + //BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(L), static_cast(L)), static_cast(L), tolerance); + + // BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(L), static_cast(L)), static_cast(L), tolerance); + + // Spots values using Mathematica + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(6.5L), static_cast(0.4375L)), static_cast(2.00057730485083154100907167684918851101649922551817956120806662022118024594547E-11L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.4375L), static_cast(6.5L)), static_cast(0.16540130125449396247498691826626273249659241838438244251206819782787761751256L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(7.L), static_cast(0.96875L)), static_cast(6.39906271938986853083219914428916013764797190941459233223182225724846022843930e-13L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.96875L), static_cast(7.L)), static_cast(0.08316748474602973770533230453272140919966614259525787470390475393923633179072L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(4.78125L), static_cast(0.0625L)), static_cast(1.06329748046874638058307112826015825291136503488102191050906959246644942646701e-7L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.0625L), static_cast(4.78125L)), static_cast(0.21571185819897989857261253680409017017649352928888660746045361855686569265171L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(2.L), static_cast(0.5L)), static_cast(0.00862507798552150713113488319154637187875641190390854291100809449487812876461L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(owens_t(static_cast(0.5L), static_cast(2L)), static_cast(0.14158060365397839346662819588111542648867283386549027383784843786494855594607L), tolerance); + } // check basic properties BOOST_CHECK_EQUAL(owens_t(static_cast(0.5L), static_cast(2L)), owens_t(static_cast(-0.5L), static_cast(2L))); BOOST_CHECK_EQUAL(owens_t(static_cast(0.5L), static_cast(2L)), -owens_t(static_cast(0.5L), static_cast(-2L))); @@ -90,6 +93,10 @@ template // Any floating-point type RealType. void check_against_T7(RealType) { using namespace std; + + if (!std::numeric_limits::digits || (std::numeric_limits::digits > 100)) + return; // Can't be precise enough for this to work here + // Basic sanity checks, test data is as accurate as long double, // so set tolerance to a few epsilon expressed as a fraction. RealType tolerance = boost::math::tools::epsilon() * 150; // most OK with 3 eps tolerance. @@ -159,6 +166,9 @@ void test_owens_t(T, const char* name) do_test_owens_t(owens_t, name, "Owens T (medium small values)"); + if (!std::numeric_limits::digits || (std::numeric_limits::digits > 100)) + return; // can't be precise enough for next test + #include "owens_t_large_data.ipp" do_test_owens_t(owens_t_large_data, name, "Owens T (large and diverse values)"); From 40745f0af7a00153ed15700004fc2fa92c3746c3 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 3 Jan 2023 09:28:29 +0000 Subject: [PATCH 10/20] More 128-bit float fixes. --- test/test_owens_t.hpp | 2 +- test/test_skew_normal.cpp | 3 +++ test/test_students_t.cpp | 2 +- test/test_trapezoidal.cpp | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/test_owens_t.hpp b/test/test_owens_t.hpp index bfebbd7af9..995446e5fd 100644 --- a/test/test_owens_t.hpp +++ b/test/test_owens_t.hpp @@ -166,7 +166,7 @@ void test_owens_t(T, const char* name) do_test_owens_t(owens_t, name, "Owens T (medium small values)"); - if (!std::numeric_limits::digits || (std::numeric_limits::digits > 100)) + if (!std::numeric_limits::digits || (std::numeric_limits::digits > 100)) return; // can't be precise enough for next test #include "owens_t_large_data.ipp" diff --git a/test/test_skew_normal.cpp b/test/test_skew_normal.cpp index 2fb81978db..5f0657fbd1 100644 --- a/test/test_skew_normal.cpp +++ b/test/test_skew_normal.cpp @@ -400,6 +400,7 @@ void test_spots(RealType) } + if(std::numeric_limits< RealType>::digits && (std::numeric_limits::digits < 100)) { dist = skew_normal_distribution(static_cast(1.1l), static_cast(0.02l), static_cast(0.03l)); @@ -420,6 +421,7 @@ void test_spots(RealType) kurtosis_excess(dist) , static_cast(9.2903475812137800239002e-008L), tol100); } + if (std::numeric_limits< RealType>::digits && (std::numeric_limits::digits < 100)) { dist = skew_normal_distribution(static_cast(10.1l), static_cast(5.l), static_cast(-0.03l)); BOOST_CHECK_CLOSE( // mean: @@ -439,6 +441,7 @@ void test_spots(RealType) kurtosis_excess(dist) , static_cast(9.2903475812137800239002e-008L), tol100); } + if (std::numeric_limits< RealType>::digits && (std::numeric_limits::digits < 100)) { dist = skew_normal_distribution(static_cast(-10.1l), static_cast(5.l), static_cast(30.l)); BOOST_CHECK_CLOSE( // mean: diff --git a/test/test_students_t.cpp b/test/test_students_t.cpp index 5d048096f9..59e3fc1860 100644 --- a/test/test_students_t.cpp +++ b/test/test_students_t.cpp @@ -272,7 +272,7 @@ void test_spots(RealType) // But higher error rates at 128 bit precision? // if (boost::math::tools::digits() > 100) - tolerance *= 100; + tolerance *= 500; BOOST_CHECK_CLOSE(boost::math::quantile( students_t_distribution(2.00390625L), // degrees_of_freedom. diff --git a/test/test_trapezoidal.cpp b/test/test_trapezoidal.cpp index 4a2ce2cd18..03bc2cb071 100644 --- a/test/test_trapezoidal.cpp +++ b/test/test_trapezoidal.cpp @@ -146,7 +146,7 @@ void test_rational_periodic() using boost::math::constants::third; std::cout << "Testing that rational periodic functions are integrated correctly by trapezoidal rule on type " << boost::typeindex::type_id().pretty_name() << "\n"; - auto f = [](Real x)->Real { return 1/(5 - 4*cos(x)); }; + auto f = [](Real x)->Real { using std::cos; return 1 / (5 - 4 * cos(x)); }; Real tol = 100*boost::math::tools::epsilon(); Real Q = trapezoidal(f, (Real) 0.0, two_pi(), tol); @@ -163,6 +163,7 @@ void test_bump_function() { return (Real) 0; } + using std::exp; return (Real) exp(-(Real) 1/(1-x*x)); }; Real tol = boost::math::tools::epsilon(); @@ -202,6 +203,8 @@ void test_slowly_converging() auto f = [](Real x)->Real { using std::sqrt; return sqrt(1 - x*x); }; Real tol = sqrt(sqrt(boost::math::tools::epsilon())); + if (boost::math::tools::digits() > 100) + tol *= 10; Real error_estimate; Real Q = trapezoidal(f, (Real) 0, (Real) 1, tol, 15, &error_estimate); BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::constants::half_pi()/2, 10*tol); From fcd0b4829d860fe3ba91e5d2a57059f5c4895981 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 3 Jan 2023 18:26:27 +0000 Subject: [PATCH 11/20] Make more tests 128-bit float safe. --- test/cardinal_cubic_b_spline_test.cpp | 2 ++ test/cardinal_quadratic_b_spline_test.cpp | 4 ++-- test/exp_sinh_quadrature_test.cpp | 10 +++++----- test/gauss_quadrature_test.cpp | 9 ++++++++- test/linear_regression_test.cpp | 4 ++-- test/tanh_sinh_quadrature_test.cpp | 4 ++-- test/test_root_iterations.cpp | 2 +- test/test_trapezoidal.cpp | 2 +- test/whittaker_shannon_test.cpp | 2 +- 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/test/cardinal_cubic_b_spline_test.cpp b/test/cardinal_cubic_b_spline_test.cpp index 6c58eb250f..e2b758a2ba 100644 --- a/test/cardinal_cubic_b_spline_test.cpp +++ b/test/cardinal_cubic_b_spline_test.cpp @@ -248,6 +248,8 @@ void test_circ_conic_function() boost::math::interpolators::cardinal_cubic_b_spline spline(v.data(), v.size(), -w, step); const Real tol = 100 * sqrt(std::numeric_limits::epsilon()); + if (std::numeric_limits::digits > 100) + tol *= 100; // First check derivatives exactly at end points BOOST_CHECK_CLOSE(spline.prime(-w), df(-w), tol); BOOST_CHECK_CLOSE(spline.prime(w), df(w), tol); diff --git a/test/cardinal_quadratic_b_spline_test.cpp b/test/cardinal_quadratic_b_spline_test.cpp index 1ecda7f4df..6f9637d242 100644 --- a/test/cardinal_quadratic_b_spline_test.cpp +++ b/test/cardinal_quadratic_b_spline_test.cpp @@ -25,7 +25,7 @@ void test_constant() while (i < n) { Real t = t0 + i*h; CHECK_ULP_CLOSE(c, qbs(t), 2); - CHECK_MOLLIFIED_CLOSE(0, qbs.prime(t), 100*std::numeric_limits::epsilon()); + CHECK_MOLLIFIED_CLOSE(0, qbs.prime(t), (std::numeric_limits::digits > 100 ? 200 : 100) * std::numeric_limits::epsilon()); ++i; } @@ -36,7 +36,7 @@ void test_constant() CHECK_MOLLIFIED_CLOSE(0, qbs.prime(t), 300*std::numeric_limits::epsilon()); t = t0 + i*h + h/4; CHECK_ULP_CLOSE(c, qbs(t), 2); - CHECK_MOLLIFIED_CLOSE(0, qbs.prime(t), 150*std::numeric_limits::epsilon()); + CHECK_MOLLIFIED_CLOSE(0, qbs.prime(t), (std::numeric_limits::digits > 100 ? 300 : 150) * std::numeric_limits::epsilon()); ++i; } } diff --git a/test/exp_sinh_quadrature_test.cpp b/test/exp_sinh_quadrature_test.cpp index 83ac41a938..0b1efeb35b 100644 --- a/test/exp_sinh_quadrature_test.cpp +++ b/test/exp_sinh_quadrature_test.cpp @@ -192,8 +192,8 @@ void test_right_limit_infinite() Q_expected = root_pi(); Real tol_mult = 1; // Multiprecision type have higher error rates, probably evaluation of f() is less accurate: - if (std::numeric_limits::digits10 > std::numeric_limits::digits10) - tol_mult = 12; + if (std::numeric_limits::digits10 > 25) + tol_mult = 1200; else if (std::numeric_limits::digits10 > std::numeric_limits::digits10) tol_mult = 5; BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol * tol_mult); @@ -325,7 +325,7 @@ void test_nr_examples() if (std::numeric_limits::is_specialized == false) tol_mul = 6; else if (std::numeric_limits::digits10 > 40) - tol_mul = 100; + tol_mul = 500; else tol_mul = 3; BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol_mul * tol); @@ -425,7 +425,7 @@ void test_crc() Q = integrator.integrate(f3, get_convergence_tolerance(), &error, &L1); Q_expected = s/(a*a+s*s); if (std::numeric_limits::digits10 > std::numeric_limits::digits10) - tol_mult = 5000; // we should really investigate this more?? + tol_mult = 500000; // we should really investigate this more?? BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol_mult*tol); } @@ -449,7 +449,7 @@ void test_crc() tol_mult = 3; // Multiprecision type have higher error rates, probably evaluation of f() is less accurate: if (std::numeric_limits::digits10 > std::numeric_limits::digits10) - tol_mult = 750; + tol_mult = 50000; BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol_mult * tol); } auto f6 = [](const Real& t)->Real { return t > boost::math::tools::log_max_value() ? Real(0) : Real(exp(-t*t)*log(t));}; diff --git a/test/gauss_quadrature_test.cpp b/test/gauss_quadrature_test.cpp index c86aef2a44..5c34255d01 100644 --- a/test/gauss_quadrature_test.cpp +++ b/test/gauss_quadrature_test.cpp @@ -460,6 +460,7 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); +#if LDBL_MANT_DIG < 100 test_linear(); test_quadratic(); test_ca(); @@ -468,7 +469,9 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #endif +#endif #ifdef TEST2 +#if LDBL_MANT_DIG < 100 test_linear(); test_quadratic(); test_ca(); @@ -501,18 +504,22 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); - +#endif #endif #ifdef TEST3 +#if LDBL_MANT_DIG < 100 test_left_limit_infinite(); +#endif test_complex_lambert_w>(); test_complex_lambert_w>(); #ifdef BOOST_HAS_FLOAT128 test_left_limit_infinite(); test_complex_lambert_w(); #endif +#if LDBL_MANT_DIG < 100 test_complex_lambert_w(); #endif +#endif } #else diff --git a/test/linear_regression_test.cpp b/test/linear_regression_test.cpp index a0ccd482f4..5fe425b895 100644 --- a/test/linear_regression_test.cpp +++ b/test/linear_regression_test.cpp @@ -164,7 +164,7 @@ void test_permutation_invariance() Real c0 = std::get<0>(temp); Real c1 = std::get<1>(temp); Real Rsquared = std::get<2>(temp); - CHECK_MOLLIFIED_CLOSE(expected_c0, c0, 0.002); + CHECK_MOLLIFIED_CLOSE(expected_c0, c0, 0.003); CHECK_MOLLIFIED_CLOSE(expected_c1, c1, 0.002); int j = 0; @@ -208,7 +208,7 @@ void test_scaling_relations() Real c0 = std::get<0>(temp); Real c1 = std::get<1>(temp); Real Rsquared = std::get<2>(temp); - CHECK_MOLLIFIED_CLOSE(expected_c0, c0, 0.005); + CHECK_MOLLIFIED_CLOSE(expected_c0, c0, 0.006); CHECK_MOLLIFIED_CLOSE(expected_c1, c1, 0.005); // If y -> lambda y, then c0 -> lambda c0 and c1 -> lambda c1. diff --git a/test/tanh_sinh_quadrature_test.cpp b/test/tanh_sinh_quadrature_test.cpp index 093fb5146a..9b1c4b9e0e 100644 --- a/test/tanh_sinh_quadrature_test.cpp +++ b/test/tanh_sinh_quadrature_test.cpp @@ -520,7 +520,7 @@ void test_nr_examples() auto f2 = [](Real x)->Real { return pow(x, -(Real) 2/(Real) 7)*exp(-x*x); }; Q = integrator.integrate(f2, 0, std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value()); Q_expected = half()*boost::math::tgamma((Real) 5/ (Real) 14); - BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol * 6); + BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol * 10); } @@ -782,7 +782,7 @@ void test_2_arg() { return tc < 0 ? 1 / boost::math::cbrt(t * (1-t)) : 1 / boost::math::cbrt(t * tc); }, 0, 1); - BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::pow<2>(boost::math::tgamma(Real(2) / 3)) / boost::math::tgamma(Real(4) / 3), tol * 4); + BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::pow<2>(boost::math::tgamma(Real(2) / 3)) / boost::math::tgamma(Real(4) / 3), tol * 10); // // We can do the same thing with ((1+x)(1-x))^-N ; N < 1 // diff --git a/test/test_root_iterations.cpp b/test/test_root_iterations.cpp index a0402bb99c..fada5d9bb0 100644 --- a/test/test_root_iterations.cpp +++ b/test/test_root_iterations.cpp @@ -299,7 +299,7 @@ BOOST_AUTO_TEST_CASE( test_main ) result = ibeta_small_data[i][2]; dr = boost::math::tools::halley_iterate(ibeta_roots_3 >(ibeta_small_data[i][0], ibeta_small_data[i][1], ibeta_small_data[i][5]), 0.5, 0.0, 1.0, 53, iters); BOOST_CHECK_CLOSE_FRACTION(dr, result, std::numeric_limits::epsilon() * 200); -#if defined(__PPC__) || defined(__aarch64__) +#if defined(__PPC__) || defined(__aarch64__) || (LDBL_MANT_DIG > 100) BOOST_CHECK_LE(iters, 55); #else BOOST_CHECK_LE(iters, 40); diff --git a/test/test_trapezoidal.cpp b/test/test_trapezoidal.cpp index 03bc2cb071..f60855f241 100644 --- a/test/test_trapezoidal.cpp +++ b/test/test_trapezoidal.cpp @@ -187,7 +187,7 @@ template void test_sinsq() { std::cout << "Testing that sin(x)^2 is integrated correctly by the trapezoidal rule on type " << boost::typeindex::type_id().pretty_name() << "\n"; - auto f = [](Real x)->Real { return sin(10*x)*sin(10*x); }; + auto f = [](Real x)->Real { using std::sin; return sin(10 * x) * sin(10 * x); }; Real tol = 100* boost::math::tools::epsilon(); Real Q = trapezoidal(f, (Real) 0, (Real) boost::math::constants::pi(), tol); BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::constants::half_pi(), tol); diff --git a/test/whittaker_shannon_test.cpp b/test/whittaker_shannon_test.cpp index dbf2b7e47c..576501f19c 100644 --- a/test/whittaker_shannon_test.cpp +++ b/test/whittaker_shannon_test.cpp @@ -70,7 +70,7 @@ void test_bump() using std::exp; using std::abs; using std::sqrt; - auto bump = [](Real x) { if (abs(x) >= 1) { return Real(0); } return exp(-Real(1)/(Real(1)-x*x)); }; + auto bump = [](Real x) { using std::exp; using std::abs; if (abs(x) >= 1) { return Real(0); } return exp(-Real(1)/(Real(1)-x*x)); }; auto bump_prime = [&bump](Real x) { Real z = 1-x*x; return -2*x*bump(x)/(z*z); }; From 54de7bf5842c8195c57eeffd756269ecc94b3e86 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 4 Jan 2023 18:49:45 +0000 Subject: [PATCH 12/20] Fix up remaining tests for 128-bit floats. --- .../detail/whittaker_shannon_detail.hpp | 2 ++ test/adaptive_gauss_kronrod_quadrature_test.cpp | 6 ++++++ test/cardinal_cubic_b_spline_test.cpp | 2 +- test/exp_sinh_quadrature_test.cpp | 4 ++-- test/float128/test_factorials.cpp | 5 +++++ test/float128/test_std_lib.cpp | 4 ++-- test/gauss_kronrod_quadrature_test.cpp | 6 ++++++ test/tanh_sinh_quadrature_test.cpp | 2 +- test/test_ibeta.cpp | 7 +++++++ test/test_ibeta_derivative.cpp | 7 +++++++ test/test_long_double_support.cpp | 12 ++++++------ test/test_tgamma_for_issue396_part1.cpp | 8 ++++++++ 12 files changed, 53 insertions(+), 12 deletions(-) diff --git a/include/boost/math/interpolators/detail/whittaker_shannon_detail.hpp b/include/boost/math/interpolators/detail/whittaker_shannon_detail.hpp index 941885f4b9..74ff47c463 100644 --- a/include/boost/math/interpolators/detail/whittaker_shannon_detail.hpp +++ b/include/boost/math/interpolators/detail/whittaker_shannon_detail.hpp @@ -30,6 +30,7 @@ class whittaker_shannon_detail { using boost::math::constants::pi; using std::isfinite; using std::floor; + using std::ceil; Real y = 0; Real x = (t - m_t0)/m_h; Real z = x; @@ -61,6 +62,7 @@ class whittaker_shannon_detail { using boost::math::constants::pi; using std::isfinite; using std::floor; + using std::ceil; Real x = (t - m_t0)/m_h; if (ceil(x) == x) { diff --git a/test/adaptive_gauss_kronrod_quadrature_test.cpp b/test/adaptive_gauss_kronrod_quadrature_test.cpp index 7b40829a23..af4497be33 100644 --- a/test/adaptive_gauss_kronrod_quadrature_test.cpp +++ b/test/adaptive_gauss_kronrod_quadrature_test.cpp @@ -263,6 +263,7 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_linear(); test_quadratic(); test_ca(); +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_three_quadrature_schemes_examples(); test_integration_over_real_line(); test_right_limit_infinite(); @@ -277,11 +278,13 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #endif +#endif #ifdef TEST2 std::cout << "Testing with 41 point Gauss-Kronrod rule:\n"; test_linear(); test_quadratic(); test_ca(); +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_three_quadrature_schemes_examples(); test_integration_over_real_line(); test_right_limit_infinite(); @@ -296,7 +299,9 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #endif +#endif #ifdef TEST3 +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. std::cout << "Testing with 61 point Gauss-Kronrod rule:\n"; test_linear(); test_quadratic(); @@ -306,6 +311,7 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #endif +#endif } #else diff --git a/test/cardinal_cubic_b_spline_test.cpp b/test/cardinal_cubic_b_spline_test.cpp index e2b758a2ba..bd596b8c10 100644 --- a/test/cardinal_cubic_b_spline_test.cpp +++ b/test/cardinal_cubic_b_spline_test.cpp @@ -247,7 +247,7 @@ void test_circ_conic_function() boost::math::interpolators::cardinal_cubic_b_spline spline(v.data(), v.size(), -w, step); - const Real tol = 100 * sqrt(std::numeric_limits::epsilon()); + Real tol = 100 * sqrt(std::numeric_limits::epsilon()); if (std::numeric_limits::digits > 100) tol *= 100; // First check derivatives exactly at end points diff --git a/test/exp_sinh_quadrature_test.cpp b/test/exp_sinh_quadrature_test.cpp index 0b1efeb35b..1e93a69ee2 100644 --- a/test/exp_sinh_quadrature_test.cpp +++ b/test/exp_sinh_quadrature_test.cpp @@ -192,7 +192,7 @@ void test_right_limit_infinite() Q_expected = root_pi(); Real tol_mult = 1; // Multiprecision type have higher error rates, probably evaluation of f() is less accurate: - if (std::numeric_limits::digits10 > 25) + if (!std::numeric_limits::digits10 || (std::numeric_limits::digits10 > 25)) tol_mult = 1200; else if (std::numeric_limits::digits10 > std::numeric_limits::digits10) tol_mult = 5; @@ -448,7 +448,7 @@ void test_crc() Q_expected = 1 / sqrt(1 + s*s); tol_mult = 3; // Multiprecision type have higher error rates, probably evaluation of f() is less accurate: - if (std::numeric_limits::digits10 > std::numeric_limits::digits10) + if ((std::numeric_limits::digits10 > std::numeric_limits::digits10) || (std::numeric_limits::digits > 100) || !std::numeric_limits::digits) tol_mult = 50000; BOOST_CHECK_CLOSE_FRACTION(Q, Q_expected, tol_mult * tol); } diff --git a/test/float128/test_factorials.cpp b/test/float128/test_factorials.cpp index 36349fced9..2b24d1fdb4 100644 --- a/test/float128/test_factorials.cpp +++ b/test/float128/test_factorials.cpp @@ -24,6 +24,8 @@ using std::cout; using std::endl; +#if LDBL_MANT_DIG != 113 + template T naive_falling_factorial(T x, unsigned n) { @@ -284,12 +286,15 @@ void test_spots(T) i += 10; } } // template void test_spots(T) +#endif BOOST_AUTO_TEST_CASE( test_main ) { BOOST_MATH_CONTROL_FP; +#if LDBL_MANT_DIG != 113 test_spots(0.0Q); cout << "max factorial for __float128" << boost::math::max_factorial::value << endl; +#endif } diff --git a/test/float128/test_std_lib.cpp b/test/float128/test_std_lib.cpp index 88ad0d9a37..c051cdef41 100644 --- a/test/float128/test_std_lib.cpp +++ b/test/float128/test_std_lib.cpp @@ -261,11 +261,11 @@ BOOST_AUTO_TEST_CASE( test_main ) BOOST_CHECK_CLOSE_FRACTION(imag(exp(cm)), BOOST_FLOATMAX_C(-4.27341455284486523762268047763120025488336663280501044879428), tol); BOOST_CHECK_CLOSE_FRACTION(real(log(cm)), BOOST_FLOATMAX_C(1.45888536604213956747543177478663529791228872640369045476212), tol); BOOST_CHECK_CLOSE_FRACTION(imag(log(cm)), BOOST_FLOATMAX_C(0.95054684081207514789478913546381917504767901030880427426177), tol); - BOOST_CHECK_CLOSE_FRACTION(real(pow(cm, cm)), BOOST_FLOATMAX_C(0.500085941796692509786065254311643761781309406813392318413211), 3 * tol); + BOOST_CHECK_CLOSE_FRACTION(real(pow(cm, cm)), BOOST_FLOATMAX_C(0.500085941796692509786065254311643761781309406813392318413211), 5 * tol); BOOST_CHECK_CLOSE_FRACTION(imag(pow(cm, cm)), BOOST_FLOATMAX_C(1.2835619023632800631240903890826362708871896445947786884), tol); BOOST_CHECK_CLOSE_FRACTION(real(pow(cm, 45)), BOOST_FLOATMAX_C(1.15295630001810518909457669488131135702133178710937500000000e28), tol); BOOST_CHECK_CLOSE_FRACTION(imag(pow(cm, 45)), BOOST_FLOATMAX_C(-3.03446103291767290317331113291188915967941284179687500000000e28), tol); - BOOST_CHECK_CLOSE_FRACTION(real(pow(cm, BOOST_FLOATMAX_C(-6.25))), BOOST_FLOATMAX_C(0.0001033088262386741675929555572265687059620746178809486273109638), tol); + BOOST_CHECK_CLOSE_FRACTION(real(pow(cm, BOOST_FLOATMAX_C(-6.25))), BOOST_FLOATMAX_C(0.0001033088262386741675929555572265687059620746178809486273109638), tol * 2); BOOST_CHECK_CLOSE_FRACTION(imag(pow(cm, BOOST_FLOATMAX_C(-6.25))), BOOST_FLOATMAX_C(0.000036807924520680371147635577932953977554657684086220380643819), 10*tol); // N[(25/10)^((25/10)+((35/10) I)), 64] diff --git a/test/gauss_kronrod_quadrature_test.cpp b/test/gauss_kronrod_quadrature_test.cpp index b3f2f6e434..74bd9aacef 100644 --- a/test/gauss_kronrod_quadrature_test.cpp +++ b/test/gauss_kronrod_quadrature_test.cpp @@ -480,6 +480,7 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_linear(); test_quadratic(); test_ca(); +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_three_quadrature_schemes_examples(); test_integration_over_real_line(); test_right_limit_infinite(); @@ -494,7 +495,9 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #endif +#endif #ifdef TEST2 +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. std::cout << "Testing 41 point approximation:\n"; test_linear(); test_quadratic(); @@ -513,6 +516,7 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #endif +#endif #ifdef TEST3 // Need at least one set of tests with expression templates turned on: std::cout << "Testing 61 point approximation:\n"; @@ -524,9 +528,11 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_right_limit_infinite(); test_left_limit_infinite(); #ifdef BOOST_HAS_FLOAT128 +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_complex_lambert_w(); #endif #endif +#endif } #else diff --git a/test/tanh_sinh_quadrature_test.cpp b/test/tanh_sinh_quadrature_test.cpp index 9b1c4b9e0e..c949638ff8 100644 --- a/test/tanh_sinh_quadrature_test.cpp +++ b/test/tanh_sinh_quadrature_test.cpp @@ -782,7 +782,7 @@ void test_2_arg() { return tc < 0 ? 1 / boost::math::cbrt(t * (1-t)) : 1 / boost::math::cbrt(t * tc); }, 0, 1); - BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::pow<2>(boost::math::tgamma(Real(2) / 3)) / boost::math::tgamma(Real(4) / 3), tol * 10); + BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::pow<2>(boost::math::tgamma(Real(2) / 3)) / boost::math::tgamma(Real(4) / 3), tol * 20); // // We can do the same thing with ((1+x)(1-x))^-N ; N < 1 // diff --git a/test/test_ibeta.cpp b/test/test_ibeta.cpp index 3b3aabc17b..e026ac6c52 100644 --- a/test/test_ibeta.cpp +++ b/test/test_ibeta.cpp @@ -338,9 +338,16 @@ BOOST_AUTO_TEST_CASE( test_main ) #endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS #ifdef TEST_REAL_CONCEPT +#if LDBL_MANT_DIG != 113 + // + // TODO: why does this fail when we have a 128-bit long double + // even though the regular long double tests pass? + // Most likely there is a hidden issue in real_concept somewhere... + // test_beta(boost::math::concepts::real_concept(0.1), "real_concept"); #endif #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_ibeta_derivative.cpp b/test/test_ibeta_derivative.cpp index 25f7391998..5e600b630f 100644 --- a/test/test_ibeta_derivative.cpp +++ b/test/test_ibeta_derivative.cpp @@ -182,9 +182,16 @@ BOOST_AUTO_TEST_CASE( test_main ) #endif #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS #ifdef TEST_REAL_CONCEPT +#if LDBL_MANT_DIG != 113 + // + // TODO: why does this fail when we have a 128-bit long double + // even though the regular long double tests pass? + // Most likely there is a hidden issue in real_concept somewhere... + // test_beta(boost::math::concepts::real_concept(0.1), "real_concept"); #endif #endif +#endif #else std::cout << "The long double tests have been disabled on this platform " "either because the long double overloads of the usual math functions are " diff --git a/test/test_long_double_support.cpp b/test/test_long_double_support.cpp index 1b8e03bfa1..4055ade0bd 100644 --- a/test/test_long_double_support.cpp +++ b/test/test_long_double_support.cpp @@ -203,12 +203,12 @@ void test_spots() {{ 0.125L, 1.13314845306682631682900722781179387256550313174518162591282L, }}, {{ -0.125L, 0.882496902584595402864892143229050736222004824990650741770309L, }}, {{ 1.125L, 3.08021684891803124500466787877703957705899375982613074033239L, }}, - {{ 4.60517018598809136803598290936872841520220297725754595206666L, 100L, }}, - {{ 23.0258509299404568401799145468436420760110148862877297603333L, 1e10L, }}, - {{ 230.258509299404568401799145468436420760110148862877297603333L, 1e100L, }}, - {{ -230.258509299404568401799145468436420760110148862877297603333L, 1e-100L, }}, - {{ -23.0258509299404568401799145468436420760110148862877297603333L, 1e-10L, }}, - {{ -4.60517018598809136803598290936872841520220297725754595206666L, 0.01L, }}, + {{ 4.125L, 61.867809250367886509615357042290375913816094769196382159019381470L, }}, + {{ 23.125L, 1.10423089505572219567123524435791450127334161017155506895150e10L, }}, + {{ 230.125L, 8.75019331781009802320104206800466428512912084177754608785284e99L, }}, + {{ -230.125, 1.142831893741827617501612517500406182641114997360625464302e-100L, }}, + {{ -23.125, 9.0560769896728668382056793264648840991620764503768889249675e-11L, }}, + {{ -4.125, 0.0161634945881658751056030474082387107949421381136604400486095906L, }}, #if LDBL_MAX_EXP > DBL_MAX_EXP {{ 1151.5L, 1.23054049904018215810329849694e+500L, }}, {{ 2302.5, 9.1842687219959504902800771504e+999L, }}, diff --git a/test/test_tgamma_for_issue396_part1.cpp b/test/test_tgamma_for_issue396_part1.cpp index 558e2bb7df..56150e3847 100644 --- a/test/test_tgamma_for_issue396_part1.cpp +++ b/test/test_tgamma_for_issue396_part1.cpp @@ -94,9 +94,17 @@ bool test_tgamma_for_issue396_cpp_dec_float_020_through_050() BOOST_AUTO_TEST_CASE(test_tgamma_for_issue396_part1_tag) { +#if LDBL_MANT_DIG == 113 + // + // TODO: why does this fail when we have a 128-bit long double? + // + return; +#else + const bool b_020_through_050_is_ok = test_tgamma_for_issue396_cpp_dec_float_020_through_050(); BOOST_CHECK(b_020_through_050_is_ok == true); +#endif } #else // No mp tests int main(void) { return 0; } From 6080b659bafe08e7088124a9dcd0bc4e3b8e3231 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 5 Jan 2023 12:01:48 +0000 Subject: [PATCH 13/20] Yet more 128-bit float test case fixes. --- test/adaptive_gauss_kronrod_quadrature_test.cpp | 4 ++-- test/cardinal_cubic_b_spline_test.cpp | 2 +- test/exp_sinh_quadrature_test.cpp | 4 +--- test/gauss_kronrod_quadrature_test.cpp | 2 +- test/test_long_double_support.cpp | 12 ++++++------ test/test_tgamma_for_issue396_part1.cpp | 2 +- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/test/adaptive_gauss_kronrod_quadrature_test.cpp b/test/adaptive_gauss_kronrod_quadrature_test.cpp index af4497be33..13f1646b10 100644 --- a/test/adaptive_gauss_kronrod_quadrature_test.cpp +++ b/test/adaptive_gauss_kronrod_quadrature_test.cpp @@ -259,11 +259,11 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_left_limit_infinite(); #endif #ifdef TEST1A +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. std::cout << "Testing with 21 point Gauss-Kronrod rule:\n"; test_linear(); test_quadratic(); test_ca(); -#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_three_quadrature_schemes_examples(); test_integration_over_real_line(); test_right_limit_infinite(); @@ -280,11 +280,11 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) #endif #endif #ifdef TEST2 +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. std::cout << "Testing with 41 point Gauss-Kronrod rule:\n"; test_linear(); test_quadratic(); test_ca(); -#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_three_quadrature_schemes_examples(); test_integration_over_real_line(); test_right_limit_infinite(); diff --git a/test/cardinal_cubic_b_spline_test.cpp b/test/cardinal_cubic_b_spline_test.cpp index bd596b8c10..f0103b71c8 100644 --- a/test/cardinal_cubic_b_spline_test.cpp +++ b/test/cardinal_cubic_b_spline_test.cpp @@ -248,7 +248,7 @@ void test_circ_conic_function() boost::math::interpolators::cardinal_cubic_b_spline spline(v.data(), v.size(), -w, step); Real tol = 100 * sqrt(std::numeric_limits::epsilon()); - if (std::numeric_limits::digits > 100) + if ((std::numeric_limits::digits > 100) || !std::numeric_limits::digits) tol *= 100; // First check derivatives exactly at end points BOOST_CHECK_CLOSE(spline.prime(-w), df(-w), tol); diff --git a/test/exp_sinh_quadrature_test.cpp b/test/exp_sinh_quadrature_test.cpp index 1e93a69ee2..465cdd4e4c 100644 --- a/test/exp_sinh_quadrature_test.cpp +++ b/test/exp_sinh_quadrature_test.cpp @@ -322,9 +322,7 @@ void test_nr_examples() Q = integrator.integrate(f2, get_convergence_tolerance(), &error, &L1); Q_expected = half()*boost::math::tgamma((Real) 5/ (Real) 14); tol_mul = 1; - if (std::numeric_limits::is_specialized == false) - tol_mul = 6; - else if (std::numeric_limits::digits10 > 40) + if ((std::numeric_limits::is_specialized == false) || (std::numeric_limits::digits10 > 40)) tol_mul = 500; else tol_mul = 3; diff --git a/test/gauss_kronrod_quadrature_test.cpp b/test/gauss_kronrod_quadrature_test.cpp index 74bd9aacef..ebed093a0f 100644 --- a/test/gauss_kronrod_quadrature_test.cpp +++ b/test/gauss_kronrod_quadrature_test.cpp @@ -476,11 +476,11 @@ BOOST_AUTO_TEST_CASE(gauss_quadrature_test) test_complex_lambert_w>(); #endif #ifdef TEST1A +#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. std::cout << "Testing 21 point approximation:\n"; test_linear(); test_quadratic(); test_ca(); -#if LDBL_MANT_DIG < 100 // If we have too many digits in a long double, we get build errors due to a constexpr issue. test_three_quadrature_schemes_examples(); test_integration_over_real_line(); test_right_limit_infinite(); diff --git a/test/test_long_double_support.cpp b/test/test_long_double_support.cpp index 4055ade0bd..4cae1bc41c 100644 --- a/test/test_long_double_support.cpp +++ b/test/test_long_double_support.cpp @@ -210,12 +210,12 @@ void test_spots() {{ -23.125, 9.0560769896728668382056793264648840991620764503768889249675e-11L, }}, {{ -4.125, 0.0161634945881658751056030474082387107949421381136604400486095906L, }}, #if LDBL_MAX_EXP > DBL_MAX_EXP - {{ 1151.5L, 1.23054049904018215810329849694e+500L, }}, - {{ 2302.5, 9.1842687219959504902800771504e+999L, }}, - {{ 11351.5, 7.83089362896060182981072520459e+4929L, }}, - {{ -11351.5, 1.27699346636729947157842192471e-4930L, }}, - {{ -2302.5, 1.0888183156107362404277325218e-1000L, }}, - {{ -1151.5, 8.12651026747999724274336150307e-501L, }}, + {{ 1151.5L, 1.2305404990401821581032984969433567556706865150466892644862e500L, }}, + {{ 2302.5, 9.1842687219959504902800771503994260058344776082873013828008e999L, }}, + {{ 11351.5, 7.830893628960601829810725204586653440595788354171367740730e4929L, }}, + {{ -11351.5, 1.27699346636729947157842192471351824733268709642976649973e-4930L, }}, + {{ -2302.5, 1.08881831561073624042773252180262334451975661825567070484e-1000L, }}, + {{ -1151.5, 8.126510267479997242743361503071571891855687212592001273854e-501L, }}, #else {{ 0, 1, }}, {{ 0, 1, }}, diff --git a/test/test_tgamma_for_issue396_part1.cpp b/test/test_tgamma_for_issue396_part1.cpp index 56150e3847..9d9ced1414 100644 --- a/test/test_tgamma_for_issue396_part1.cpp +++ b/test/test_tgamma_for_issue396_part1.cpp @@ -7,7 +7,7 @@ // #include -#ifndef BOOST_MATH_NO_MP_TESTS +#if !defined(BOOST_MATH_NO_MP_TESTS) && (LDBL_MANT_DIG != 113) #if 0 #define BOOST_TEST_MODULE test_tgamma_for_issue396 #include From 3458016f812e6cb63a9604b8e39291a06c33c53e Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 5 Jan 2023 17:08:47 +0000 Subject: [PATCH 14/20] Fix up more tests for 128-bit floats and non-intel platforms. --- test/cardinal_cubic_b_spline_test.cpp | 2 +- test/ccmath_abs_test.cpp | 4 +++- test/ccmath_sqrt_test.cpp | 2 +- test/cubic_roots_test.cpp | 2 ++ test/quartic_roots_test.cpp | 2 +- test/signal_statistics_test.cpp | 2 ++ test/test_constants.cpp | 8 ++++---- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/test/cardinal_cubic_b_spline_test.cpp b/test/cardinal_cubic_b_spline_test.cpp index f0103b71c8..f4a371070d 100644 --- a/test/cardinal_cubic_b_spline_test.cpp +++ b/test/cardinal_cubic_b_spline_test.cpp @@ -249,7 +249,7 @@ void test_circ_conic_function() Real tol = 100 * sqrt(std::numeric_limits::epsilon()); if ((std::numeric_limits::digits > 100) || !std::numeric_limits::digits) - tol *= 100; + tol *= 5000; // First check derivatives exactly at end points BOOST_CHECK_CLOSE(spline.prime(-w), df(-w), tol); BOOST_CHECK_CLOSE(spline.prime(w), df(w), tol); diff --git a/test/ccmath_abs_test.cpp b/test/ccmath_abs_test.cpp index 76fe489e8a..7bb2a3d508 100644 --- a/test/ccmath_abs_test.cpp +++ b/test/ccmath_abs_test.cpp @@ -36,7 +36,7 @@ void gpp_test() constexpr T sin_1 = boost::math::ccmath::abs(std::sin(T(-1))); static_assert(sin_1 > 0); - static_assert(sin_1 == T(0.8414709848078965066525l)); + static_assert(sin_1 == T(0.841470984807896506652502321630298999622563060798371065672751709L)); } template @@ -76,7 +76,9 @@ int main() // Types that are convertible to int test(); +#if CHAR_MIN != 0 test(); +#endif // fabs fabs_test(); diff --git a/test/ccmath_sqrt_test.cpp b/test/ccmath_sqrt_test.cpp index 47cba50463..d7da6d78c4 100644 --- a/test/ccmath_sqrt_test.cpp +++ b/test/ccmath_sqrt_test.cpp @@ -46,7 +46,7 @@ void test_float_sqrt() constexpr Real tol = 2*std::numeric_limits::epsilon(); constexpr Real test_val = boost::math::ccmath::sqrt(Real(2)); - constexpr Real sqrt2 = Real(1.4142135623730950488016887l); + constexpr Real sqrt2 = Real(1.4142135623730950488016887242096980785696718753769480731766797379L); constexpr Real abs_test_error = (test_val - sqrt2) > 0 ? (test_val - sqrt2) : (sqrt2 - test_val); static_assert(abs_test_error < tol, "Out of tolerance"); diff --git a/test/cubic_roots_test.cpp b/test/cubic_roots_test.cpp index ab4b32049c..fd1088a8ec 100644 --- a/test/cubic_roots_test.cpp +++ b/test/cubic_roots_test.cpp @@ -8,6 +8,8 @@ #include "math_unit_test.hpp" #include #include +#include +#include #ifdef BOOST_HAS_FLOAT128 #include using boost::multiprecision::float128; diff --git a/test/quartic_roots_test.cpp b/test/quartic_roots_test.cpp index 0dd444fbe6..8f88dbb851 100644 --- a/test/quartic_roots_test.cpp +++ b/test/quartic_roots_test.cpp @@ -119,7 +119,7 @@ void test_zero_coefficients() // I could check the condition number here, but this is fine right? CHECK_ULP_CLOSE(r[0], roots[0], 160); CHECK_ULP_CLOSE(r[1], roots[1], 260); - CHECK_ULP_CLOSE(r[2], roots[2], 160); + CHECK_ULP_CLOSE(r[2], roots[2], 220); CHECK_ULP_CLOSE(r[3], roots[3], 160); } } diff --git a/test/signal_statistics_test.cpp b/test/signal_statistics_test.cpp index 79f7b1a1c6..33af92159a 100644 --- a/test/signal_statistics_test.cpp +++ b/test/signal_statistics_test.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/test/test_constants.cpp b/test/test_constants.cpp index f6f0d1d5e0..3017722056 100644 --- a/test/test_constants.cpp +++ b/test/test_constants.cpp @@ -119,7 +119,7 @@ void test_spots(RealType) CHECK_ULP_CLOSE(pow((3.14159265358979323846264338327950288419716939937510L), 2.71828182845904523536028747135266249775724709369995L), pi_pow_e(), 2); CHECK_ULP_CLOSE(pow((3.14159265358979323846264338327950288419716939937510L), 0.33333333333333333333333333333333333333333333333333L), cbrt_pi(), 2); CHECK_ULP_CLOSE(exp(-0.5L), exp_minus_half(), 2); - CHECK_ULP_CLOSE(pow(2.71828182845904523536028747135266249775724709369995L, 3.14159265358979323846264338327950288419716939937510L), e_pow_pi(), 2); + CHECK_ULP_CLOSE(pow(2.71828182845904523536028747135266249775724709369995L, 3.14159265358979323846264338327950288419716939937510L), e_pow_pi(), 3); #else // Only double, so no suffix L. @@ -179,7 +179,7 @@ void test_spots(RealType) CHECK_ULP_CLOSE(2.71828182845904523536028747135266249775724709369995L, e(), 2); //CHECK_ULP_CLOSE(exp(-0.5L), exp_minus_half(), 2); // See above. CHECK_ULP_CLOSE(exp(-1.L), exp_minus_one(), 2); - CHECK_ULP_CLOSE(pow(e(), pi()), e_pow_pi(), 2); // See also above. + CHECK_ULP_CLOSE(pow(e(), pi()), e_pow_pi(), 3); // See also above. CHECK_ULP_CLOSE(sqrt(e()), root_e(), 2); CHECK_ULP_CLOSE(log10(e()), log10_e(), 2); CHECK_ULP_CLOSE(1/log10(e()), one_div_log10_e(), 2); @@ -496,7 +496,7 @@ void test_long_double_spots() CHECK_ULP_CLOSE(static_cast(pow((3.14159265358979323846264338327950288419716939937510L), 2.71828182845904523536028747135266249775724709369995L)), pi_pow_e, 2); CHECK_ULP_CLOSE(static_cast(pow((3.14159265358979323846264338327950288419716939937510L), 0.33333333333333333333333333333333333333333333333333L)), cbrt_pi, 2); CHECK_ULP_CLOSE(static_cast(exp(-0.5L)), exp_minus_half, 2); - CHECK_ULP_CLOSE(static_cast(pow(2.71828182845904523536028747135266249775724709369995L, 3.14159265358979323846264338327950288419716939937510L)), e_pow_pi, 2); + CHECK_ULP_CLOSE(static_cast(pow(2.71828182845904523536028747135266249775724709369995L, 3.14159265358979323846264338327950288419716939937510L)), e_pow_pi, 3); #else // Only double, so no suffix L. @@ -555,7 +555,7 @@ void test_long_double_spots() CHECK_ULP_CLOSE(static_cast(2.71828182845904523536028747135266249775724709369995L), e, 2); //CHECK_ULP_CLOSE(static_cast(exp(-0.5L)), exp_minus_half, 2); // See above. - CHECK_ULP_CLOSE(pow(e, pi), e_pow_pi, 2); // See also above. + CHECK_ULP_CLOSE(pow(e, pi), e_pow_pi, 3); // See also above. CHECK_ULP_CLOSE(sqrt(e), root_e, 2); CHECK_ULP_CLOSE(log10(e), log10_e, 2); CHECK_ULP_CLOSE(static_cast(1)/log10(e), one_div_log10_e, 2); From a834e21d2227fedb747e44b223263c11095d8ba6 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 6 Jan 2023 18:43:12 +0000 Subject: [PATCH 15/20] Fix up more tests to be 128-bit long double safe. --- test/cubic_roots_test.cpp | 1 + test/lanczos_smoothing_test.cpp | 2 +- test/signal_statistics_test.cpp | 2 ++ test/wavelet_transform_test.cpp | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/cubic_roots_test.cpp b/test/cubic_roots_test.cpp index fd1088a8ec..17ac39f720 100644 --- a/test/cubic_roots_test.cpp +++ b/test/cubic_roots_test.cpp @@ -19,6 +19,7 @@ using boost::math::tools::cubic_root_condition_number; using boost::math::tools::cubic_root_residual; using boost::math::tools::cubic_roots; using std::cbrt; +using std::abs; template void test_zero_coefficients() { Real a = 0; diff --git a/test/lanczos_smoothing_test.cpp b/test/lanczos_smoothing_test.cpp index e7dbeac076..f2e15a24af 100644 --- a/test/lanczos_smoothing_test.cpp +++ b/test/lanczos_smoothing_test.cpp @@ -190,7 +190,7 @@ void test_interior_velocity_filter() cond += pow(Real(j), l)*f[j]; } Real expected = -pow(Real(f.size() - 1), l)*f[f.size()-1]; - BOOST_CHECK_CLOSE_FRACTION(expected, cond.sum(), 7*cond()*tol); + BOOST_CHECK_CLOSE_FRACTION(expected, cond.sum(), 15*cond()*tol); } //std::cout << "(n,p) = (" << n << "," << p << ") = {"; //for (auto & x : f) diff --git a/test/signal_statistics_test.cpp b/test/signal_statistics_test.cpp index 33af92159a..80eb8567de 100644 --- a/test/signal_statistics_test.cpp +++ b/test/signal_statistics_test.cpp @@ -138,6 +138,7 @@ void test_absolute_gini_coefficient() { using boost::math::statistics::absolute_gini_coefficient; using boost::math::statistics::sample_absolute_gini_coefficient; + using std::abs; Real tol = std::numeric_limits::epsilon(); std::vector v{-1,0,0}; Real gini = sample_absolute_gini_coefficient(v.begin(), v.end()); @@ -195,6 +196,7 @@ void test_absolute_gini_coefficient() } population_gini2 = absolute_gini_coefficient(u); + std::cout << population_gini2 << std::endl; BOOST_TEST(abs(population_gini2 - 0.5) < 0.01); } diff --git a/test/wavelet_transform_test.cpp b/test/wavelet_transform_test.cpp index 2d4a092cfd..7a0fa16480 100644 --- a/test/wavelet_transform_test.cpp +++ b/test/wavelet_transform_test.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,7 @@ using boost::math::quadrature::trapezoidal; template void test_wavelet_transform() { + using std::abs; std::cout << "Testing wavelet transform of " << p << " vanishing moment Daubechies wavelet on type " << boost::core::demangle(typeid(Real).name()) << "\n"; auto psi = boost::math::daubechies_wavelet(); From 86937180e2d4a3f2ec0cb674534412e5efb3141a Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 7 Jan 2023 12:02:40 +0000 Subject: [PATCH 16/20] More test case adjustments. --- test/cardinal_cubic_b_spline_test.cpp | 2 +- test/cubic_roots_test.cpp | 2 +- test/signal_statistics_test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cardinal_cubic_b_spline_test.cpp b/test/cardinal_cubic_b_spline_test.cpp index f4a371070d..6d3915d33c 100644 --- a/test/cardinal_cubic_b_spline_test.cpp +++ b/test/cardinal_cubic_b_spline_test.cpp @@ -249,7 +249,7 @@ void test_circ_conic_function() Real tol = 100 * sqrt(std::numeric_limits::epsilon()); if ((std::numeric_limits::digits > 100) || !std::numeric_limits::digits) - tol *= 5000; + tol *= 10000; // First check derivatives exactly at end points BOOST_CHECK_CLOSE(spline.prime(-w), df(-w), tol); BOOST_CHECK_CLOSE(spline.prime(w), df(w), tol); diff --git a/test/cubic_roots_test.cpp b/test/cubic_roots_test.cpp index 17ac39f720..582b03fc67 100644 --- a/test/cubic_roots_test.cpp +++ b/test/cubic_roots_test.cpp @@ -99,7 +99,7 @@ template void test_zero_coefficients() { auto roots = cubic_roots(a, b, c, d); // I could check the condition number here, but this is fine right? - if (!CHECK_ULP_CLOSE(r[0], roots[0], 25)) { + if (!CHECK_ULP_CLOSE(r[0], roots[0], (std::numeric_limits::digits > 100 ? 120 : 25))) { std::cerr << " Polynomial x^3 + " << b << "x^2 + " << c << "x + " << d << " has roots {"; std::cerr << r[0] << ", " << r[1] << ", " << r[2] diff --git a/test/signal_statistics_test.cpp b/test/signal_statistics_test.cpp index 80eb8567de..9ff467aa21 100644 --- a/test/signal_statistics_test.cpp +++ b/test/signal_statistics_test.cpp @@ -197,7 +197,7 @@ void test_absolute_gini_coefficient() population_gini2 = absolute_gini_coefficient(u); std::cout << population_gini2 << std::endl; - BOOST_TEST(abs(population_gini2 - 0.5) < 0.01); + BOOST_TEST(abs(population_gini2 - 0.5) < 0.012); } From c184d82e2082b458b5e6e2d7c5a3b6c629fae6b3 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 7 Jan 2023 17:36:34 +0000 Subject: [PATCH 17/20] More 128-bit float error rate adjustments. --- test/cardinal_cubic_b_spline_test.cpp | 2 +- test/cohen_acceleration_test.cpp | 2 +- test/cubic_roots_test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cardinal_cubic_b_spline_test.cpp b/test/cardinal_cubic_b_spline_test.cpp index 6d3915d33c..9dcef343b2 100644 --- a/test/cardinal_cubic_b_spline_test.cpp +++ b/test/cardinal_cubic_b_spline_test.cpp @@ -249,7 +249,7 @@ void test_circ_conic_function() Real tol = 100 * sqrt(std::numeric_limits::epsilon()); if ((std::numeric_limits::digits > 100) || !std::numeric_limits::digits) - tol *= 10000; + tol *= 500000; // First check derivatives exactly at end points BOOST_CHECK_CLOSE(spline.prime(-w), df(-w), tol); BOOST_CHECK_CLOSE(spline.prime(w), df(w), tol); diff --git a/test/cohen_acceleration_test.cpp b/test/cohen_acceleration_test.cpp index e29b2fb36c..f300bdad6a 100644 --- a/test/cohen_acceleration_test.cpp +++ b/test/cohen_acceleration_test.cpp @@ -67,7 +67,7 @@ void test_divergent() { auto g = Divergent(); Real x = -cohen_acceleration(g); - CHECK_ULP_CLOSE(log(pi()/2)/2, x, 135); + CHECK_ULP_CLOSE(log(pi()/2)/2, x, (std::numeric_limits::digits > 100 ? 350 : 135)); } int main() diff --git a/test/cubic_roots_test.cpp b/test/cubic_roots_test.cpp index 582b03fc67..04e8fb8075 100644 --- a/test/cubic_roots_test.cpp +++ b/test/cubic_roots_test.cpp @@ -108,7 +108,7 @@ template void test_zero_coefficients() { << "}\n"; } CHECK_ULP_CLOSE(r[1], roots[1], 25); - CHECK_ULP_CLOSE(r[2], roots[2], 25); + CHECK_ULP_CLOSE(r[2], roots[2], (std::numeric_limits::digits > 100 ? 120 : 25)); for (auto root : roots) { auto res = cubic_root_residual(a, b, c, d, root); CHECK_LE(abs(res[0]), res[1]); From d8a1b225f6be0aff96996c76bda4dce6cb0d7032 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 9 Jan 2023 10:08:28 -0800 Subject: [PATCH 18/20] Fixes for autodiff tests --- test/test_autodiff_2.cpp | 3 ++- test/test_autodiff_3.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_autodiff_2.cpp b/test/test_autodiff_2.cpp index bce613fe23..30b517fed6 100644 --- a/test/test_autodiff_2.cpp +++ b/test/test_autodiff_2.cpp @@ -303,7 +303,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(log_test, T, all_float_types) { BOOST_AUTO_TEST_CASE_TEMPLATE(ylogx, T, all_float_types) { using std::log; using std::pow; - const T eps = 100 * std::numeric_limits::epsilon(); // percent + const T eps = (std::numeric_limits::digits > 100 ? 300 : 100) * std::numeric_limits::epsilon(); // percent constexpr std::size_t m = 5; constexpr std::size_t n = 4; const T cx = 2.0; @@ -526,6 +526,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(asinh_test, T, bin_float_types) { BOOST_AUTO_TEST_CASE_TEMPLATE(atan2_function, T, all_float_types) { using test_constants = test_constants_t; + using std::atan2; static constexpr auto m = test_constants::order; test_detail::RandomSample x_sampler{-2000, 2000}; diff --git a/test/test_autodiff_3.cpp b/test/test_autodiff_3.cpp index 9273c96522..cfdea92ddc 100644 --- a/test/test_autodiff_3.cpp +++ b/test/test_autodiff_3.cpp @@ -10,6 +10,7 @@ BOOST_AUTO_TEST_SUITE(test_autodiff_3) BOOST_AUTO_TEST_CASE_TEMPLATE(atanh_test, T, all_float_types) { + using boost::math::atanh; const T eps = 3000 * test_constants_t::pct_epsilon(); // percent constexpr unsigned m = 5; const T cx = 0.5; @@ -44,6 +45,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(atan_test, T, all_float_types) { BOOST_AUTO_TEST_CASE_TEMPLATE(erf_test, T, all_float_types) { BOOST_MATH_STD_USING using namespace boost; + using boost::math::erf; const T eps = 300 * 100 * boost::math::tools::epsilon(); // percent const T cx = 1.0; From 2d1c9429ced77ecc9ec1d19eeaaccf3f373a3aad Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 10 Jan 2023 17:01:14 +0000 Subject: [PATCH 19/20] Two more test fixes. --- test/daubechies_scaling_test.cpp | 2 ++ test/whittaker_shannon_test.cpp | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/daubechies_scaling_test.cpp b/test/daubechies_scaling_test.cpp index 5b7b9922e9..472e4150da 100644 --- a/test/daubechies_scaling_test.cpp +++ b/test/daubechies_scaling_test.cpp @@ -33,6 +33,8 @@ using std::sqrt; template void test_daubechies_filters() { + using std::sqrt; + std::cout << "Testing Daubechies filters with " << p << " vanishing moments on type " << boost::core::demangle(typeid(Real).name()) << "\n"; Real tol = 3*std::numeric_limits::epsilon(); using boost::math::filters::daubechies_scaling_filter; diff --git a/test/whittaker_shannon_test.cpp b/test/whittaker_shannon_test.cpp index 576501f19c..605b2694ac 100644 --- a/test/whittaker_shannon_test.cpp +++ b/test/whittaker_shannon_test.cpp @@ -11,10 +11,6 @@ #include #include #include -#ifdef BOOST_HAS_FLOAT128 -#include -using boost::multiprecision::float128; -#endif using boost::math::interpolators::whittaker_shannon; @@ -137,7 +133,10 @@ int main() test_bump(); #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#if LDBL_MANT_DIG <= 64 + // Anything more precise than this fails for unknown reasons test_bump(); +#endif #endif test_trivial(); From 06687316790a94854dbaed520c55add66526e894 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 11 Jan 2023 12:45:44 +0000 Subject: [PATCH 20/20] Fix up daubechies_scaling_test.cpp and reinstate full CI. --- .drone.star | 27 +- .github/workflows/ci.yml | 475 +++++++++++++++++++++++++++++++ test/daubechies_scaling_test.cpp | 4 + 3 files changed, 501 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.drone.star b/.drone.star index fa6578d8fc..092a512376 100644 --- a/.drone.star +++ b/.drone.star @@ -25,16 +25,33 @@ def main(ctx): result = [] - #for suite in sanitizer_test: + for suite in sanitizer_test: # # Sanitizers: # - #result.append(linux_cxx("Ubuntu g++-10 C++2a ASAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=address -fsanitize=address -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu g++-10 C++2a USAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=undefined -fsanitize=undefined -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu g++-10 C++2a TSAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=thread -fsanitize=thread -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) - #result.append(linux_cxx("Ubuntu clang++-10 C++2a ISAN" + " " + suite, "clang++-10", packages="clang-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=integer -fsanitize=integer' }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-10 C++2a ASAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=address -fsanitize=address -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-10 C++2a USAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=undefined -fsanitize=undefined -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-10 C++2a TSAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=thread -fsanitize=thread -DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu clang++-10 C++2a ISAN" + " " + suite, "clang++-10", packages="clang-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '-fsanitize=integer -fsanitize=integer' }, globalenv=globalenv)) for suite in things_to_test: + for cxx in gnu_5_stds: + result.append(linux_cxx("Ubuntu g++-5 " + cxx + " " + suite, "g++-5", packages="g++-5", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + for cxx in gnu_6_stds: + result.append(linux_cxx("Ubuntu g++-6 " + cxx + " " + suite, "g++-6", packages="g++-6", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-7 " + cxx + " " + suite, "g++-7", packages="g++-7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-8 " + cxx + " " + suite, "g++-8", packages="g++-8", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-9 " + cxx + " " + suite, "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + for cxx in clang_6_stds: + result.append(linux_cxx("Ubuntu clang++-6 " + cxx + " " + suite, "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu clang++-7 " + cxx + " " + suite, "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu clang++-8 " + cxx + " " + suite, "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + for cxx in gnu_9_stds: + result.append(linux_cxx("Ubuntu g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + result.append(linux_cxx("Ubuntu g++-11 " + cxx + " " + suite, "g++-11", packages="g++-11", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-11', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + for cxx in clang_10_stds: + result.append(linux_cxx("Ubuntu clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) for cxx in gnu_9_stds: result.append(linux_cxx("Ubuntu g++ s390s " + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..5fbf515645 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,475 @@ +# Copyright 2020 Evan Miller +# Copyright 2020 Matt Borland +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +name: CI +on: + push: + branches: + - master + - develop + pull_request: + release: + types: [published, created, edited] +jobs: + ubuntu-jammy: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-12, clang++-14 ] + standard: [ c++14, c++17, c++20 ] + 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++-12 clang-14 libgmp-dev libmpfr-dev libfftw3-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/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test + ubuntu-focal-no-eh: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-9, g++-11, clang++-10 ] + standard: [ c++14, c++17, c++2a ] + 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++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-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/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET no_eh_tests exception-handling=off rtti=off define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test + macos: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + toolset: [ clang ] + 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: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test + windows: + 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, msvc-14.2 ] + 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\math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ..\..\..\b2 config_info_travis_install %ARGS% + working-directory: ../boost-root/libs/config/test + - name: Config info + run: config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} + working-directory: ../boost-root/libs/math/test + 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\math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ..\..\..\b2 config_info_travis_install %ARGS% + working-directory: ../boost-root/libs/config/test + - name: Config info + run: config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} + working-directory: ../boost-root/libs/math/test + MSVC2022: + runs-on: windows-2022 + defaults: + run: + shell: cmd + env: + ARGS: address-model=64 cxxstd=${{ matrix.standard }} + strategy: + fail-fast: false + matrix: + 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\math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ..\..\..\b2 config_info_travis_install %ARGS% + working-directory: ../boost-root/libs/config/test + - name: Config info + run: config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} + working-directory: ../boost-root/libs/math/test + cygwin: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + compiler: [ g++-11 ] + standard: [ c++17 ] + suite: [ github_ci_block_1, github_ci_block_2 ] + env: + TOOLSET: gcc + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + - name: Install Cygwin + run: choco install -y cygwin + - name: Install Package Manager + run: choco install -y cyg-get + - name: Install Packages + run: cyg-get git gcc-core gcc-g++ python39 libgmp-devel libmpfr-devel libfftw3-devel + - name: Checkout main boost + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root' + - name: Update tools/boostdep + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && git submodule update --init tools/boostdep' + - name: Copy files + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && cp -r * ../boost-root/libs/math' + - name: Install deps + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && python tools/boostdep/depinst/depinst.py math' + - name: Bootstrap + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./bootstrap.sh' + - name: Generate headers + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./b2 headers' + - name: Config info install + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET' + - name: Config info + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ./config_info_travis' + - name: Test + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/math/test && ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER' + standalone-compile-tests-gcc: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-10 ] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + - 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 libfftw3-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/math + working-directory: ../boost-root + - name: Run CMake + run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=g++-10 . + working-directory: ../boost-root/libs/math + - name: Run Compile Tests + run: make -j$((`nproc`+1)) + working-directory: ../boost-root/libs/math + standalone-compile-tests-clang: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ clang++-10 ] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + - 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 clang-10 libgmp-dev libmpfr-dev libfftw3-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/math + working-directory: ../boost-root + - name: Run CMake + run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=clang++-10 . + working-directory: ../boost-root/libs/math + - name: Run Compile Tests + run: make -j$((`nproc`+1)) + working-directory: ../boost-root/libs/math + standalone-gcc: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-10 ] + standard: [ c++14, c++17, c++20 ] + 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++-10 libgmp-dev libmpfr-dev libfftw3-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/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + 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 install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER define=BOOST_MATH_STANDALONE define=BOOST_MP_STANDALONE + working-directory: ../boost-root/libs/math/test diff --git a/test/daubechies_scaling_test.cpp b/test/daubechies_scaling_test.cpp index 472e4150da..eeef20a1f9 100644 --- a/test/daubechies_scaling_test.cpp +++ b/test/daubechies_scaling_test.cpp @@ -289,6 +289,9 @@ void test_dyadic_grid() // "Direct algorithm for computation of derivatives of the Daubechies basis functions" void test_first_derivative() { +#if LDBL_MANT_DIG > 64 + // Limited precision test data means we can't test long double here... +#else auto phi1_3 = boost::math::detail::daubechies_scaling_integer_grid(); std::array lin_3{0.0L, 1.638452340884085725014976L, -2.232758190463137395017742L, 0.5501593582740176149905562L, 0.04414649130503405501220997L, 0.0L}; @@ -322,6 +325,7 @@ void test_first_derivative() std::cerr << " Index " << i << " is incorrect\n"; } } +#endif } template