2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-23 17:52:09 +00:00

40 Commits

Author SHA1 Message Date
jzmaddock
7fa77fcac6 Update revision history.
Regenerate docs.
2024-03-03 17:36:56 +00:00
Matt Borland
f7f96150df Update version history (#1053) 2023-11-18 15:28:38 +01:00
Matt Borland
2dd018b8c7 Revert "Update version history."
This reverts commit d938d3e836.
2023-11-18 08:30:17 +01:00
jzmaddock
d938d3e836 Update version history.
[CI SKIP]
2023-11-17 18:25:02 +00:00
jzmaddock
016da990e2 Update history.
Regenerate docs.
2023-02-23 17:13:51 +00:00
jzmaddock
b5589965e6 Update history and regenerate docs.
Also fix some missing documentation links.
[CI SKIP]
2022-03-08 15:56:22 +00:00
jzmaddock
e000cf5dd1 Update history and regenerate docs. 2021-11-05 17:53:09 +00: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
0edc9ab19b Add release notes, regenerate docs. 2021-02-26 18:38:42 +00:00
jzmaddock
64154c2d4b Update history, regenerate docs.
Add some missing files.
[CI SKIP]
2020-10-19 18:19:34 +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
jzmaddock
cb98c2959d Integrate linux performance results,
Regenerate docs.
2020-04-04 09:27:17 +01:00
jzmaddock
9af885b5fb Update history, regenerate docs.
[CI SKIP]
2020-03-24 13:06:05 +00:00
pabristow
5aacc3e167 Add missing file big_seventh.cpp 2019-11-12 09:34:48 +00: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
pabristow
44e3ed82fa [CI SKIP] typos in hypergeometrics and added a FAQ 2019-08-07 15:14:50 +01:00
pabristow
df5a6f5ac6 Many edits to provide equation indents, dozens of typos, and misc amendments, mainly cosmetic, and new index entries for better indexes 2019-08-06 15:33:22 +01:00
Nick Thompson
5650fef94e Rebuild docs. [CI SKIP] 2019-06-30 10:11:22 -04: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
3fcc5fa245 Regenerate docs.
[CI SKIP]
2019-02-27 18:36:34 +00:00
jzmaddock
c0f236e251 Merge branch 'develop' into catmull_rom
Fixed Conflicts:
	doc/Jamfile.v2

Corrected some doc formatting, and regenerated the docs.
2018-12-01 19:38:16 +00:00
jzmaddock
bed980e202 Merge branch 'develop' into lambertw 2018-08-30 10:17:19 +01:00
jzmaddock
197d3b9e70 naive_monte_carlo: Update docs.
[CI SKIP]
2018-02-16 18:32:47 +00:00
jzmaddock
8ca22fd8f1 Numerical differentiation: Update and regenerate docs. 2018-02-11 17:55:46 +00:00
jzmaddock
dd7234247c Math: Regenerate docs with re-worked TOC to better illuminate new features.
[CI SKIP]
2017-11-09 13:28:50 +00:00
pabristow
15568b8d62 Work on precision demo before holiday. OK on VS14.1 and GCC 7.1.0 but docs need much more work. 2017-09-02 12:12:10 +01:00
pabristow
c1b8ffec7c Needed to merge? 2017-08-31 12:50:11 +01:00
jzmaddock
696555e20f Regenerate documentations.
[CI skip]
2017-08-23 19:00:13 +01:00
pabristow
26aea4e7df Big refactor JM small_z and tag_type select code 2017-08-10 17:49:17 +01:00
jzmaddock
092d4580fd Update and regenerate docs. 2017-06-27 18:35:30 +01:00
pabristow
555e0f416b commit merge from develop 2017-06-22 17:05:02 +01:00
jzmaddock
69579ae210 Update gcd/lcm docs to point to Boost.Integer. 2017-04-24 19:42:22 +01:00
pabristow
ffb025ca2c First very rough prototype of Lambert W function, example of calculating diode current versus voltage, and some tests, including multiprecision and fixed_point types. Not yet using policies and trouble near the singularity at z=-exp(-1) and large z. 2016-12-22 18:30:27 +00:00
pabristow
fe4dbc344a Additions to cstdfloat and float128 docs 2016-08-03 12:03:26 +01:00
pabristow
7a7d3321fe Moved polystuff to tools, added JWM as author and numerous minor edits 2015-12-14 16:13:05 +00:00
jzmaddock
5d0606445d Update history and regenerate docs. 2015-09-07 18:35:47 +01:00
pabristow
3928cf1bb9 git rm --cached -- /html/*.html to get out git of all generated files except math.css 2015-03-12 14:42:54 +00:00
pabristow
5638fe9be2 Re-structured to separate into tools (rooting and minimization) and internals, and links revised to suit. 2015-03-05 15:25:19 +00:00