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

60 Commits

Author SHA1 Message Date
mzhelyez
8bb3a24162 added graphs 2025-08-24 14:16:55 +02:00
Matt Borland
8f843fd131 Merge branch 'master' into develop 2024-10-29 08:51:15 -04:00
John Maddock
e03fd8bf4f Merge branch 'stat_saspoint5' of https://github.com/tk-yoshimura/boost_math into map_airy_etc 2024-07-25 11:01:48 +01:00
John Maddock
bb25838e82 Merge branch 'stat_holtsmark' of https://github.com/tk-yoshimura/boost_math into map_airy_etc 2024-07-25 11:01:03 +01:00
John Maddock
02e08e165a Merge branch 'stat_mapairy' of https://github.com/tk-yoshimura/boost_math into map_airy_etc 2024-07-25 11:00:19 +01:00
tk-yoshimura
e407cadd0d Add saspoint5 document graphs 2024-07-23 23:21:22 +09:00
tk-yoshimura
f2a0fc9723 Add holtsmark document graphs 2024-07-23 23:12:01 +09:00
tk-yoshimura
72afe90646 Add mapairy document graphs 2024-07-23 22:56:27 +09:00
jzmaddock
07d97df50c Landau Integration testing (#1159)
* Add landau distribution

* Add landau limit test case

* Add landau document

* Landau integration testing.
Hook up tests to Jamfile.
Hook up docs by adding to dist_reference.qbk.
Add std::float64_t tests.
Hook up concept tests in instantiate.hpp.
Add to distributions.hpp
Update static_asserts with better error messages.
Add header inclusion test in dist_landau_incl_test.cpp (and fix resulting errors)

* Add missing #include.

* More Landau test fixes.

* Fix C++23 stdfloat test names.

* Final (doc) update to Landau.

---------

Co-authored-by: tk-yoshimura <yoshimura8192@gmail.com>
2024-07-21 11:54:58 +01:00
jzmaddock
8fa1be8e5e Doc update:
correct hypergeometric equation (again).
Add section on standalone usage.
2021-07-11 19:43:33 +01:00
jzmaddock
a7bfb5a914 Prep for 1.77:
Rework hypergeometric distro equations.
Fix up Fibonacci docs.
Fix Fibonacci constexpr and noexcept usage and add to testing.
Regenerate docs.
2021-07-11 19:43:31 +01:00
jzmaddock
4cfcee9717 Doc update:
correct hypergeometric equation (again).
Add section on standalone usage.
2021-06-28 19:51:30 +01:00
jzmaddock
d4de174bbb Prep for 1.77:
Rework hypergeometric distro equations.
Fix up Fibonacci docs.
Fix Fibonacci constexpr and noexcept usage and add to testing.
Regenerate docs.
2021-06-27 19:38:05 +01:00
jzmaddock
4cdc6450d5 Merge branch 'develop'
Fixed Conflicts:
	include/boost/math/special_functions/log1p.hpp
2021-06-27 09:49:39 +01: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
Nick
cbd2af2890 Cohen acceleration (#415)
* Cohen acceleration

Accelerates convergence of an alternating series by a method designed by Cohen, Villegas, and Zagier.
2020-08-09 09:55:56 -04:00
Nick
ee2cd5d5e5 Luroth expansions (#401) 2020-07-18 09:28:39 -04:00
Nick
1ac89b2b02 Simple continued fraction (#377)
* Simple continued fraction [CI SKIP]

* Comments on error analysis [CI SKIP]

* Simple continued fraction [CI SKIP]

* Clarify comment and kick off build.
2020-06-26 14:50:04 -04:00
NAThompson
a228b3337d Use consistent notation in nc_chi_squ [CI SKIP] 2020-06-11 15:21:23 -04:00
Nick
9a45e6a358 AGM 2020-05-29 21:50:25 -04:00
Eduardo García-Portugués
286709aecd Change equation in documentation 2020-01-23 22:17:15 +01:00
jzmaddock
3934e61d7c Update history and regenerate docs.
Tweak some hypergeometric html file names for consistency.
[CI SKIP]
2019-10-20 20:08:19 +01:00
jzmaddock
3130c30e4f pFq: Add tests for hypergeometric_pFq_precision.
Update docs.
Document recurrence tools.
2019-08-01 15:19:01 +01:00
jzmaddock
af46a3a74e pFq: Add documentation. 2019-07-17 18:24:55 +01:00
jzmaddock
472e34efc4 Merge branch 'develop' into hypergeometric_soc_2014 2019-07-02 18:12:43 +01:00
jzmaddock
c6fb970ec6 1F1: Doc update. 2019-07-02 18:09:42 +01:00
jzmaddock
648ebfdc25 1F1: Add regularized version. 2019-04-17 18:27:42 +01:00
jzmaddock
fb613328bf 1F1: reformat table with equations rather than text so they don't line wrap.
[CI SKIP]
2019-03-09 08:37:59 +00:00
jzmaddock
7eb4c411ce 1F1: more or less complete documentation.
[CI SKIP]
2019-03-08 19:17:07 +00:00
jzmaddock
47fb08dd70 1F1: More doc updates. 2019-03-04 18:11:27 +00:00
jzmaddock
f3f303ecff 1F1: start working on the docs.
[CI SKIP]
2019-03-02 19:26:13 +00:00
Matt Pulver
9418a4e2d4 Doc: Add sections Migrating Code, and Function Writing Guidelines. Additional math function overloads: acosh, asinh, atanh, cosh, erf, lambert_w0, sinc, sinh, tanh. Attempt to fix appveyor errors. 2019-02-12 07:43:04 -05:00
Matt Pulver
7748f2ea19 Feedback from boostorg/math/#176 2019-02-03 20:45:35 -05:00
Matt Pulver
ad96b617cc Add differentiation/autodiff.hpp. 2019-01-23 14:17:02 -05:00
jzmaddock
52079d2d23 Merge branch 'develop' into hypergeometric_soc_2014
Fixed Conflicts:
	doc/equations/generate.sh
2018-10-18 11:11:13 +01:00
jzmaddock
049c670409 Add another test case for tanh_sinh complex support, and update docs with examples. 2018-10-11 08:49:05 +01:00
jzmaddock
7cc4d04edf Hypergeometric: Start adding docs. 2018-01-20 17:44:46 +00:00
jzmaddock
d38b640d1c Update tool paths. 2018-01-20 17:42:41 +00:00
jzmaddock
38eb9d3e38 Update docs for new Bessel K0 and K1 approximation code. 2017-01-24 18:35:54 +00:00
jzmaddock
cc8e300bae Update I0 and I1 to use better approximations from Pavel Holoborodko
See: http://www.advanpix.com/2015/11/11/rational-approximations-for-the-modified-bessel-function-of-the-first-kind-i0-computations-double-precision/
2017-01-18 18:56:27 +00:00
jzmaddock
64b7e244d0 Document Airy zeros implementation. 2015-05-28 11:32:05 +01:00
pabristow
1f0552daea merged develop into rooting and rebuilt html 2015-03-12 12:31:01 +00:00
jzmaddock
a663232f38 [polygamma] Add two special cases for x = 1 and x = 0.5. 2014-11-22 18:37:31 +00:00
jzmaddock
ea950fbd27 Synch docs to code. 2014-11-20 10:41:26 +00:00
jzmaddock
8147bb92d8 [Polygamma] Add equations and graphs. 2014-11-08 19:08:00 +00:00
jzmaddock
1beedd6487 [polygamma] Initial docs. 2014-11-08 11:50:48 +00:00
jzmaddock
9cdbebb629 Regenerate SVG and PNG files to our spec. 2014-08-29 18:50:51 +01:00
sguazt
a8ac5aab96 [distributions] Hyper-Exponential: finalized doc. 2014-08-26 17:07:24 +02:00
jzmaddock
27e6693e1a Fix multi-line equations to line up the equals signs, then regenerate the png and svg files. 2014-01-27 19:22:28 +00:00