2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-23 15:52:16 +00:00
Commit Graph

184 Commits

Author SHA1 Message Date
Matt Borland
d96d63e3d9 Add superproject include path
[standalone]
2021-04-27 19:31:18 +03:00
Matt Borland
937cabe674 Add extra include path
[standalone]
2021-04-27 18:47:31 +03:00
Matt Borland
4931200ad6 Fix for CMake superproject failure
[standalone]
2021-04-26 22:19:15 +03:00
Matt Borland
12b3c8a7e7 Standalone tests (#606)
* Add missing distribution compile tests

* Add cstdfloat compile tests

* Rename and finish differentiation

* Add interpolators compile tests and fixes

* Reorganize/add quadrature compile tests

* Add missing sf tests and fixes for failures

* Add tools incl tests and fixes

* Add compile tests to jamfile plus collected fixes

* Collected fixes for CI failures

* Fix fftw config

* Remove lexical cast from arcsine dist [ci skip]

* Improve cstdfloat tests [ci skip]

* Improve differentiation tests [ci skip]

* Improve distribution testing [ci skip]

* Updates to interpolator tests [ci skip]

* Improve quadrature tests [ci skip]

* Improve sf tests [ci skip]

* Improve tools tests

* Collected CI fixes

* Fix for MSVC 14.2 array allocation error
[windows]

* MSVC 14.2 workarounds
[windows]

* Fix float128 and interpolators tests

* Add standalone testing on clang
[standalone]

* Fixes for type mismatches on MSVC
[windows]

* Fix for MSVC 14.0 fail from missing header
[windows]

* Change barycentric rational namespace
[ci skip]

* Fix standalone clang warnings

* Change namespace in barycentric examples
2021-04-22 14:44:21 -04:00
jzmaddock
adcf95b784 Merge pull request #597 from mborland/standalone
Complete Standalone Mode
2021-04-04 17:35:10 +01:00
Matt Borland
16a91de3b4 Disable standalone tests of cstdfloat concept
[standalone]
2021-04-03 16:46:00 +03:00
Matt Borland
7737659d40 Add stats include tests 2021-04-02 14:02:29 +03:00
Matt Borland
f8c0c13050 autodiff ADL fix and remove concept tests 2021-04-02 13:45:09 +03:00
Matt Borland
fe9e0c7efa Compile tests pass in standalone mode 2021-04-01 22:13:15 +03:00
jzmaddock
67aa0c1444 Deal with inspect issues in test/. 2021-03-30 17:55:13 +01:00
Matt Borland
18af162377 Change include directories 2021-03-27 18:09:38 +03:00
Matt Borland
c79965c46c Add CMake Link Flags and Reduce CI for testing 2021-03-27 17:51:40 +03:00
Matt Borland
860169d71b Add CMake compile testing [ci skip] 2021-03-27 12:18:32 +03:00
Matt Borland
1a3d06e490 Merge branch 'predef' into config 2021-03-26 19:40:18 +03:00
Matt Borland
d1cd38a517 Misc except 4x TR1 tests pass 2021-03-25 21:52:57 +03:00
Matt Borland
50cc5c5d32 distribution_tests pass in standalone mode 2021-03-25 21:02:36 +03:00
Matt Borland
a80edc889c special_fun now passes in standalone mode 2021-03-25 20:50:13 +03:00
jzmaddock
8379dae7cd Merge pull request #576 from mborland/type_traits
Remove boost.type_traits dependency
2021-03-25 08:53:03 +00:00
jzmaddock
1ead5e5739 Add missing #include tests for acosh, asinh and atanh. 2021-03-24 20:19:16 +00:00
Matt Borland
012607ea74 Remove boost.throw_exception dependency (#577)
* Remove boost.throw_exception dependency

* Remove test #define [ci skip]

* Fix missing header in sf_prime_incl_test
2021-03-23 13:04:48 -04:00
Matt Borland
0e4d6505d3 Merge branch 'throw_exception' into config 2021-03-22 19:15:28 +03:00
Matt Borland
2962de7f19 Fix missing header in sf_prime_incl_test 2021-03-22 19:11:25 +03:00
Matt Borland
26711525ca Remove uses of boost/cstdint without header called 2021-03-21 16:13:10 +03:00
Matt Borland
4b6ad919b3 Remove boost.type_traits dependency 2021-03-21 09:01:41 +03:00
Matt Borland
3f3344e838 Merge remote-tracking branch 'origin/develop' into array [ci skip] 2021-03-19 17:06:45 +03:00
Matt Borland
0339733a79 Replace BOOST_STATIC_ASSERT with static_assert
and add useful error messages
2021-03-14 22:06:15 +03:00
Matt Borland
fbadd8d653 remove boost.static_assert 2021-03-14 12:49:38 +03:00
Matt Borland
d2572ae097 Fixes for misc test suite failures 2021-03-10 21:46:56 +03:00
jzmaddock
92cf7ec7b8 Tidy up more failing tests. 2021-02-08 11:18:02 +00:00
jzmaddock
46dacdbb3c Split the multiprecision concept checks into smaller chunks for lower compiler memory usage. 2021-02-02 15:34:13 +00:00
jzmaddock
db42e6bced Add missing include.
Fixes issues exposed by changes to lexical_cast.
See https://github.com/boostorg/math/pull/433.
2020-12-19 19:31:01 +00:00
Evan Miller
18ed616376 Kolmogorov-Smirnov distribution (#422)
* Kolmogorov-Smirnov distribution #421

Add a new distribution, kolmogorov_smirnov_distribution, which takes a
parameter that represents the number of observations used in a
Kolmogorov-Smirnov test. (The K-S test is a popular test for comparing
two CDFs, but the test statistic is not implemented here.)

This implementation includes Kolmogorov's original 1st order Taylor
expansion. There is a literature on the distribution's other
mathematical properties (higher order terms and exact version); this
literature is summarized in the main header file for anyone who may
want to expand the implementation later.

The CDF is implemented using a Jacobi theta function, and the PDF is a
hand-rolled derivative of that function. Quantiles plug the CDF and PDF
into a Newton-Raphson iteration. The mean and variance have nice
closed-form expressions, and the mode uses a dumb run-time maximizer.

This commit includes graphs, a ULP plotter for the PDF, and the usual
compilation and numerical tests. The test file is on the small side, but
it integrates the distribution from zero to infinity, and covers the
quantiles pretty well. As of now the numerical tests only verify
self-consistency (e.g. distribution moments and CDF-quantile relations),
so there's room to add some external checks.

* Implement skewness for K-S distribution [CI SKIP]

The third moment integrates nicely with the help of Apery's constant
(zeta_three). Verify the result via quadrature.

* Implement kurtosis for the K-S distribution

Verify the result via quadrature.
2020-09-04 08:48:51 -04: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
e9b93b1587 Instantiate.hpp: fix for using TEST_GROUP_5/6 alone. 2020-07-09 19:06:09 +01:00
NAThompson
17c9912aba Attempt to fix compilation error of Windows. Add compiler tests for Daubechies scaling. 2020-03-06 06:33:59 -05:00
jzmaddock
dc52a787c8 daubechies.hpp: simplify header and reduce dependencies. 2020-02-28 17:24:38 +00:00
jzmaddock
2d6cd609c9 Autodiff: minimise #includes and change type_traits usage to the std versions.
Update tests to match.
2020-01-25 18:41:40 +00: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
NAThompson
869949a657 Cut down on the warnings that I've introduced slowly over time 2019-10-25 08:49:36 -04:00
jzmaddock
1ef7307577 1F1: make PP logic consistent. 2019-08-01 21:48:04 +01:00
jzmaddock
233bcfe1d8 pFq: simplify Jamfile. Fix instantiate.hpp. 2019-08-01 19:21:32 +01:00
jzmaddock
d0bdc5300b Hypergeometrics: Update to fix test failures, and improve reporting of compiler requirements. 2019-07-28 17:49:37 +01:00
jzmaddock
1511ec4d35 Merge branch 'develop' into hypergeometric_soc_2014 2019-07-19 18:55:27 +01:00
jzmaddock
0275428d5a Catmull_rom: fix vc12 and vc14 errors highlighted by the new tests. 2019-07-06 20:29:11 +01:00
jzmaddock
ed38d8f556 catmull_rom.hpp: Added missing include.
Fix concept tests and add them to the Jamfile.v2
Fixes: https://github.com/boostorg/math/issues/226
2019-07-06 09:00:50 +01:00
jzmaddock
472e34efc4 Merge branch 'develop' into hypergeometric_soc_2014 2019-07-02 18:12:43 +01:00
jzmaddock
e415650f86 prime: Correct value of max_prime and add test.
Fixes https://github.com/boostorg/math/issues/214.
2019-05-26 11:45:35 +01:00
jzmaddock
332fb32919 Merge branch 'develop' into hypergeometric_soc_2014
[CI SKIP]
2019-02-21 13:03:04 +00:00
jzmaddock
c603bf78a7 Hypergeometrics: Fix up some testing and conceptual errors flagged up by first CI run. 2019-02-06 18:42:09 +00:00
jzmaddock
695486b1ce hypergeometrics: Correct all the conceptual errors, fix up concept tests and generally test many more types.
[CI SKIP]
2019-01-18 19:31:50 +00:00