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

133 Commits

Author SHA1 Message Date
jzmaddock
dd59c01ac8 Fixes for #1198.
Use asymptotic expansion for very large a,b and add test cases.
Add some corrections to improve numeric stability.
Add better error handling of cases that explode so we get evaluation_error's.
2025-04-10 18:52:35 +01:00
René Ferdinand Rivera Morell
41f07b0794 Add support for modular build structure. (#1160)
* Make the library modular usable.

* Fix -Wundef warnings

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add missing NO_LIB usage requirements.

* Remove boost-root relative include path.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Sync upstream.

* Fix typo in test framework reference.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Switch to /boost/test//included target for header only mode of Boost.Test.

* Adjust doc build to avoid boost-root references.

* Update build deps.

* Fix project props not applying to the no_eh.obj compile.

* Update build deps.

* Add missing import-search.

* Fix float128_type checks to actually disable tests. Problem was that build is a non-free feature. Which can't be acquired through a usage requirement.

* GPU Batch 7

Fix igamma_large support on device

Add GPU support to toms748

Add GPU support to igamma_inv

Add GPU markers to gamma_inva

Add GPU Markers to lgamma_small

Remove STL usage from gamma

Remove NVRTC workaround

Fix fraction use of STL headers

Mark gamma functions in fwd

Disable declval on all GPU platforms

Disable more unneeded code on device

Add forward decl for NVRTC tgamma

Disable unneeded items for all GPU

Change workaround for missing overloads

Rearrange definition location

Add include path to cuda now that workaround is removed

Fix NVRTC incompatibility with recursion and forward decls

Add tgamma_ratio CUDA and NVRTC testing

Fix NVRTC handling of gamma_p_derivative

Add gamma_p_derivative CUDA and NVRTC testing

Remove recursion from gamma_incomplete_imp

Add SYCL testing of igamma, igamma_inv, and igamma_inva

Ignore literal-range warnings

Remove use of static const char* for function name

Fix missing CUDA header

Remove calls under NVRTC to fwd decl

Add more nvrtc workarounds

Use builtin erfc instead of header cycle

Add CUDA and NVRTC testing of gamma_p_inv

Adjust tolerances

Add GPU support to chi squared dist

Fix static local variable

Add chi squared dist SYCL testing

Add chi squared dist CUDA testing

Add chi squared dist NVRTC testing

Add GPU support to weibull dist

Add weibull dist SYCL testing

Add weibull dist CUDA testing

Add weibull dist NVRTC testing

* Fix policy macro definition for MSVC platforms

* Don't add quadmath lib for has_128bit_floatmax_t check. It was accidentally copy+pasted.

* Fix incorrect name for float128 type check that caused it to not apear.

---------

Co-authored-by: Matt Borland <matt@mattborland.com>
2024-09-06 08:45:23 -04:00
Matt Borland
aa33cdf784 Update polynomial evaluation for NVRTC 2024-08-14 10:26:02 -04:00
Matt Borland
8594af7ad0 Update polynomial and rationals 2024-07-23 08:11:22 -04:00
jzmaddock
70cdb37759 Merge pull request #1141 from boostorg/nc_t_improvements
Prevent passing denormals in calculation.
2024-06-02 15:25:36 +01:00
jzmaddock
9e6f2b1b40 Update Non central T PDF:
Lot's more tests, especially in the tails.
Added Hypergeometric and Integration methods as fallbacks.
2024-05-31 11:54:52 +01:00
Matt Borland
f4e547c2d8 Change generation to abs x<=1 2024-05-30 08:42:12 +02:00
Nick
fccad84bf5 Random search (#1071) 2024-01-24 17:26:24 -08:00
jzmaddock
d5960de3db Fix case where b is a negative integer and z is also negative. (#983)
* Fix case where b is a negative integer and z is also negative.
Add tests etc.
Fixes: https://github.com/boostorg/math/issues/982.
2023-05-04 09:17:16 +01:00
jzmaddock
fae96bf542 S390x testing: make all the tests 128-bit float safe.
* Remove tests we don't need right now.
!!!REVERT THIS COMMIT BEFORE MERGING!!!

* Add s390x testing to drone.

* Correct drone file.

* Correct drone file (again)

* Prevent complete cancellation in bessel_jy logic.

* Correct testing for 128-bit floats.

* Make some more tests 128-bit long double safe.

* Make more tests 128-bit float safe.

* Fix some more 128-bit testing issues.

* More 128-bit float fixes.

* Make more tests 128-bit float safe.

* Fix up remaining tests for 128-bit floats.

* Yet more 128-bit float test case fixes.

* Fix up more tests for 128-bit floats and non-intel platforms.

* Fix up more tests to be 128-bit long double safe.

* More test case adjustments.

* More 128-bit float error rate adjustments.

* Fixes for autodiff tests

* Two more test fixes.

* Fix up daubechies_scaling_test.cpp and reinstate full CI.

Co-authored-by: Matt Borland <matt@mattborland.com>
2023-01-11 18:31:05 +00:00
Rose
fe48a3bba7 Junk removal
Removal of junk headers, typos, or mistakenly duplicated keywords
2022-11-05 12:14:12 -04:00
Matt Borland
e1601f129a Complete CI test with standalone mode (#680) 2022-01-14 08:12:22 -08:00
jzmaddock
84b8e4ac81 Fix inspection report issues. 2021-05-24 13:20:45 +01:00
jzmaddock
a1b1368d66 Merge branch 'develop' into bernoulli_threading_2
Fixed Conflicts:
	include/boost/math/special_functions/lanczos.hpp
2021-05-23 20:05:51 +01:00
jzmaddock
3685f6d2d2 Update lanczos_generator.cpp:
To test over a wider range of values, otherwise precision tails off for middling values of z - 100 < z < 300.  Also prints out conditioning on the near-1 or 2 approximations.
Update lanczos.hpp with the new approximations, removed 80-100 digit approximation because it basically doesn't work well.
Modified lanczos.hpp and lgamma_small.hpp to have separate lanczos g values for the near 1 or 2 approximations.
This addresses issues discussed in https://github.com/boostorg/multiprecision/pull/327.
2021-05-23 19:49:34 +01:00
jzmaddock
2de293b13f Remove unneeded library dependencies from Jamfiles. 2021-05-18 20:51:03 +01:00
Nick
0cd6039cb1 Minimax and distribution_explorer to examples. (#620)
* Minimax and distribution_explorer to examples.

* Move minimax to tools.
2021-05-03 09:12:58 -04:00
jzmaddock
adcf95b784 Merge pull request #597 from mborland/standalone
Complete Standalone Mode
2021-04-04 17:35:10 +01:00
jzmaddock
67aa0c1444 Deal with inspect issues in test/. 2021-03-30 17:55:13 +01:00
Matt Borland
ea323e6e1b Remove boost.lexical_cast dependency 2021-03-29 19:59:29 +03:00
Matt Borland
ab2d391cfb Fixes for tools tests 2021-03-26 20:15:13 +03:00
Matt Borland
9c243dbb49 Replace <boost/config> w <boost/math/tools/config> 2021-03-23 21:38:13 +03:00
Matt Borland
26711525ca Remove uses of boost/cstdint without header called 2021-03-21 16:13:10 +03:00
Matt Borland
d6a04ab194 Remove all BOOST_MATH_STATIC_ASSERT_MSG 2021-03-16 22:42:09 +03:00
Matt Borland
fbadd8d653 remove boost.static_assert 2021-03-14 12:49:38 +03:00
Matt Borland
d59c734c5e Remove boost.assert 2021-03-14 12:22:26 +03:00
jzmaddock
65c8cb24fa Fix up non-central T test data for 128-bit floats.
Fixes: https://github.com/boostorg/math/issues/544.
Also fixes uncovered issue in tgamma_ratio where we were previously relying on sub-normals to get the correct result.
2021-03-01 12:05:22 +00:00
Matt Borland
5ae92ba0c3 Replace several boost types [ci skip] 2021-02-15 16:00:08 +03:00
Matt Borland
6050bd6e17 Fix for MSVC CI Failures (#492)
* Fix for MSVC Macro substitution

* FIx t-test CI failure with MSVC-14.2, C++17, misc

* Fixs for fpclassify error and multiprecision

* Add bigobj flag fixes daubechies wavelet [CI SKIP]

* Fix bad compiler flag for mingw

* Edit jamfile

* Re-add mingw compiler guards
2021-01-18 09:38:49 -05:00
Evan Miller
d7141cd353 Jacobi Theta functions (#394)
* Jacobi Theta functions

Implementations, tests, and ULP plotting programs are provided for the
four Jacobi Theta functions per #373. Twenty-four public C++ functions
are provided in all, covering various precision-preserving scenarios.

Documentation for collaborators is provided in the code comments. Proper
documentation for end users will be provided when the implementation and
APIs are finalized.

Some tests are failing; this implementation is meant to start a
conversation. The core dilemma faced by the author was that large values
of |q| resulted in slow convergence, and sometimes wildly inaccurate
results. Following the implementation note in DLMF 20.14, I added code
to switch over to the imaginary versions of the theta functions when |q|
> 0.85.  This restored accuracy such that all of the identity tests
passed for a loose-enough epsilon, but then lost precision to the point
that the Wolfram Alpha spot checks failed. It is the author's hope that
someone with floating-point experience can tame the exponential dragons
and squeeze the ULPs back down to a reasonable range when |q| is large.

When #392 is merged I will add more thorough value tests, although I
fully expect them to fail until the underlying precision issues are
resolved.

As a final note, the precision issues do not affect the z=0 case - the
ULP plots indicate these return values within 2 ULP across all valid
|q|. So that's a start.

* [CI SKIP] Jacobi theta: Add special-value tests and more

* Add tests covering z=0 special values from MathWorld

* Add missing real_concept header

* Replace M_PI and friends with constants::pi etc

* Use BOOST_MATH_STD_USING in more places

* Jacobi theta: Test two more of Watson's identities [CI SKIP]

See https://mathworld.wolfram.com/JacobiThetaFunctions.html

(Equations 48 and 49)

* Improve precision of Jacobi theta functions [CI SKIP]

Rewrite the private imaginary versions to use double-sided summations
following DLMF 20.13.4 and 20.13.5. This cuts down the worst of the
precision issues by a factor of 10, and gets more of the tests to pass.

I am confident enough in the code path to eliminate the compile-time
__JACOBI_THETA_USE_IMAGINARY flag. In fact the imaginary-z code paths
are now enabled for all |q| > 0.04, i.e. most legal values of q.

More extensive tests will be needed to illuminate any remaining
precision issues.

* Jacobi theta: Make changes suggested in #394 [CI SKIP]

* Add LICENSE notice to main file

* Document convergence criteria

* Eliminate eps*eps = 0 logic. This causes some disagreement with the
zero returned by Wolfram Alpha for z=0, q > 0.99 in the fourth function.
Mathematically, the fourth function is never exactly zero, so I don't
trust Wolfram here.

* Per code-review comments, remove multiplications by floating-point 2.

* Tweak the plotting programs to display their titles, and to uniformly
use `float` as their CoarseType and `long double` as their
`PreciseType`.

* Add quadrature tests to Jacobi theta functions [CI SKIP]

The quadrature tests revealed a problem in the m1 functions: they too
should switch to the _IMAGINARY logic for q > exp(-pi), or will suffer
from slow convergence. Fix them.

Also tighten tolerances for many tests from sqrt(eps) to 100 * eps.

* Test Jacobi thetas against elliptic functions and elliptic integrals [CI SKIP]

See:

* https://dlmf.nist.gov/22.2
* https://dlmf.nist.gov/20.9#i

* Test Jacobi Thetas against their Laplace transforms [CI SKIP]

See:

* https://dlmf.nist.gov/20.10#ii

I did find some disagreement, and dropped the negative sign from the
theta1 equation. DLMF's theta2 and theta3 Laplace transform equations do
not agree at all with the computed values - will need to investigate.

In the meantime, the two implemented equations agree to 4 EPS so I am
keeping them.

* Add a note on using log1p with Jacobi theta functions [CI SKIP]

See discussion:

* https://github.com/boostorg/math/pull/394#issuecomment-655871762

* Add random data tests to Jacobi Theta functions [CI SKIP]

Add a test data generator program for the Jacobi theta functions.
This program will produce data for the tau parameterization, so that
precision isn't lost during the log-transformation. This distinguishes
it from the Wolfram Alpha data, which is parameterized by q.

A few of these new random-data tests are failing, but not by obscene
margins (< 100 EPS). These failures will be addressed when the test
tolerances are finalized.

* Add small-tau tests and simplify Jacobi Theta code [CI SKIP]

Add tests for small tau (i.e. large q). The tests are failing with mean
~ 200 EPS and max ~ 800 EPS. These look like worst-case input, and
should be the focus of future accuracy improvements.

This commit also simplifies the _IMAGINARY code by abstracting all of
the loops into a single svelte function.

* Add user documentation for Jacobi Theta functions [CI SKIP]

* Add function graphs to Jacobi Theta docs [CI SKIP]

* Define Jacobi Theta test tolerances [CI SKIP]

* Add implementation note on Jacobi theta functions [CI SKIP]

* Consolidate Jacobi Theta ULPs plotting programs [CI SKIP]

* Fix q domain checking of jacobi_theta4 [CI SKIP]

* Add ULPs plots to Jacobi Theta docs [CI SKIP]

Also add the built HTML files for easy evaluation. A full rebuild is
needed for the new docs to appear in the indexes.

* Add missing Jacobi Theta ULPs plots [CI SKIP]

* Add LaTeX source for Jacobi Theta equations [CI SKIP]

* Remove unused Jacobi Theta PNG equations [CI SKIP]

* Add Jacobi Theta performance script [CI SKIP]

Provided by @NAThompson.

* Remove vestigial eps*eps check from jacobi_theta3 [CI SKIP]

* Update Jacobi Theta docs per code review comments [CI SKIP]

* Enable arg promotion for Jacobi Theta functions [CI SKIP]

Add Jacobi theta functions to the instantiation tests and fix up
everything needed to make them pass. This changes the function
signatures to use promote_args.

* Fix Jacobi Theta plotting script [CI SKIP]

This script broke when the promote_args API was added.

* Change Jacobi Theta convergence criterion [CI SKIP]

Compare the non-oscillating part of the delta to the previous one.
This avoids some headaches comparing the delta to the partial sum,
because the partial sum can be a small number due to the oscillating
component alternating signs.

Because successive terms involve either q^n^2 or exp(-(pi*n)^2),
convergence should still happen pretty quickly. Graphs have been updated
and tests still passs with no noticeable difference.
2020-08-15 18:51:47 -04:00
jzmaddock
770aafe543 Correct function pointer usage. 2020-07-07 11:54:11 +01:00
jzmaddock
1f04d60436 Correct Jamfile mpfr configuration. 2020-07-06 12:52:02 +01:00
jzmaddock
f18e4c4f84 Fix case of header name, fix C++11 requirement on one test. 2020-07-06 08:21:45 +01:00
jzmaddock
b670912bc5 Fix up data generators for C++03 etc. 2020-07-05 21:28:00 +01:00
jzmaddock
1e0179c883 Remove dispatching via mpl and stick to boost::integral_constant.
Simplify the dispatching logic to use mpl::if_ and broken compiler workarounds less often.
Fixes: https://github.com/boostorg/type_traits/issues/133.
2020-01-13 15:14:48 +00:00
Brian Wignall
e3a45bd10b Fix typos, after fixing bug in typochecker 2019-12-25 22:42:26 -05:00
Brian Wignall
3c976e5e09 Fix typos 2019-12-24 21:42:09 -05:00
Brian Wignall
df17d11299 Fix more typos, via latest version of typochecker tool 2019-12-20 10:41:42 -05:00
Brian Wignall
54770599d5 Fix more typos 2019-12-16 13:35:48 -05:00
Brian Wignall
ccff3fd1b3 Fix typos 2019-12-01 08:06:17 -05:00
jzmaddock
75f77481a0 Update Lanczos generator program.
Add lanczos approximations for multiprecision types up to 100 digit precision.
Add tests for new approximations.
2019-10-18 17:58:31 +01:00
pabristow
0ab00c3f9d [CI SKIP] changes to get inspect program problem-free, but one test failure in recurrence.cpp 2019-08-23 09:25:22 +01:00
jzmaddock
5376702cc7 pFq: Add tests. 2019-07-17 18:24:07 +01:00
jzmaddock
472e34efc4 Merge branch 'develop' into hypergeometric_soc_2014 2019-07-02 18:12:43 +01:00
pabristow
02ff33c49a Several broken/missing links corrected, and lambert_w_errors_graph.cpp added. Passes local inspect.exe except on link to Boost.Test floating point that may work when built in situ. [CI SKIP] for now. 2019-05-30 16:55:15 +01:00
jzmaddock
dc7ecc0581 1F1: Exclude values very close to 1 from logarithmic testing for now.
Add tests for log and regularized cases.
Log cases still have many failures and are not yet tested.
2019-05-13 18:07:47 +01:00
jzmaddock
648ebfdc25 1F1: Add regularized version. 2019-04-17 18:27:42 +01:00
jzmaddock
52e4ee3c79 1F1: Update tests for previous changes, improve error testing code. 2019-04-14 09:51:45 +01:00
jzmaddock
91731ab5fa 1F1: Fix up b < 0 domain for extended precision types.
Update docs for b < 0 case.
2019-04-08 18:25:40 +01:00
jzmaddock
01f80a651b 1F1: Improve error plot code. 2019-04-05 18:57:10 +01:00