2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-22 03:22:28 +00:00
Commit Graph

2440 Commits

Author SHA1 Message Date
jzmaddock
d4d0297626 Merge pull request #399 from evanmiller/remove-unwanted-promotions
Reduce unwanted double promotions
2020-07-13 20:03:39 +01:00
NAThompson
696145aed2 Do not add newline to ostream operator of simple_continued_fraction; let the user. Also, remove some typos from the docs. 2020-07-12 13:51:13 -04:00
Evan Miller
9869e7a515 Fix binomial_coefficient forwarding policy
This addresses an issue where unintended double-promotion could occur.

See #398.
2020-07-10 07:08:07 -04:00
Evan Miller
5206b25e96 Merge branch 'develop' into remove-unwanted-promotions 2020-07-09 13:42:38 -04:00
Matt Borland
699d326f64 Implemented mode and associated tests (#390)
* Implemented mode and associated tests

* Clarity and complexity changes

* Added google benchmark

* Small changes to mode. More tests.

* Seperated into sorted and non-sorted functions

* Fixed data types and removed copying

* Fixed bounds checking

* Additional tests and cleanup.

* Added tests for std::list and std::forward_list

* Small testing changes and documentation

* Added modes memory allocation and faster insertion

* Changed return type, and modified tests

* Removed copied iterator and edge cases.

* Documentation fixes
2020-07-09 13:28:29 -04:00
Evan Miller
6172b5203a Reduce unwanted double promotions #398
A small audit of the Bessel and beta functions revealed a number of
places where primitive functions were being called without a Policy
argument, thus introducing double- and float-promotion in violation
of the user-provided policy. The primitive functions in question
include cbrt, cos_pi, sin_pi, lgamma, tgamma, and polygamma.

This commit passes the Policy argument down the call chain in several
locations. As part of this work, a number of internal functions have had
a Policy argument added to them. These functions include:

* airy_ai_zero_detail::initial_guess
* airy_bi_zero_detail::initial_guess
* airy_zero::equation_as_10_4_105
* binomial_ccdf (in special_functions/beta.hpp)
* bessel_zero::asymptotic_bessel_j_large_x_2
* bessel_zero::asymptotic_bessel_y_large_x_2
* bessel_zero::equation_as_9_5_26
* bessel_zero::cyl_neumann_zero_detail::equation_nist_10_21_40_a
* bessel_zero::cyl_neumann_zero_detail::equation_nist_10_21_40_b

The above functions do not have any user-facing documentation, and so
I did not preserve their non-policy function signatures.

I do not know of a good way to verify the absence of float-promotion
deep down a call chain, and so I have not added any new tests. The
existing tests in the special_fun and distribution_tests suites continue
to pass.
2020-07-09 12:21:33 -04:00
Nick Thompson
6bb0e8dee0 Add using std::isnan to pchip [CI SKIP] 2020-07-08 08:24:57 -04:00
Matt Borland
ceea26d144 boost::math::pow is not constexpr #354 (#388)
* Made pow constexpr

* Added static_assert to test

* Changed constexpr to BOOST_CXX14_CONSTEXPR
2020-07-05 13:33:37 -04:00
Nick
5a7e64a426 Tanh-sinh with MPFR test. (#389) 2020-07-04 13:09:20 -04:00
Nick
1e6b84b1e5 Fix reciprocal of min for mpfr/cpp_bin_float in continued fractions. (#385)
* Fix reciprocal of min for mpfr.

* Add comment clarifying why we scale by 16. [CI SKIP]
2020-06-30 21:01:36 -04:00
Nick
fbb62f01c5 Centered continued fractions (#379)
* Centered continued fraction [CI SKIP]

* Document centered cfrac. [CI SKIP]

* Unit tests for centered continued fraction [CI SKIP]

* Kick off build.

* Fix syntax error in docs [CI SKIP]

* Fix ADL.
2020-06-28 14:20:52 -04:00
Nick
b3edb7ec14 Fix some CI failures (#378)
* Hope this works.

* Fix compile regression.

* Fix B-spline compile test failure.
2020-06-26 14:51:37 -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
Nick
4e510da7fd Performance reporting for constants (#366)
* Performance reporting for constants [CI SKIP]

* Remove itrunc overflow. [CI SKIP]
2020-06-06 09:11:52 -04:00
Nick
4facb20ff9 Gauss's constant G:=1/agm(1,sqrt(2)) (#363) 2020-06-05 20:25:04 -04:00
Nick
4e0e8eb005 Add Feigenbaum constant. (#351)
* Add Feigenbaum constant.

* Add isnan to real_concept. Convert test_constants.cpp to math_unit_test.cpp.

* Reduce ULP tolerance to 2, which is the minimum that passes on my machine.

* Improvements to Feigenbaum.

* Ok this is pretty complicated . . . [CI SKIP]

* Take jzmaddock's suggestion to remove additions to real_concept.

* Remove test the demonstrates throw.

* Use BOOST_STATIC_ASSERT_MSG to retain C++03 compatibility.

* More precise conversion from binary to decimal.

* Plastic constant.

* Fix typos.

* New tests [CI SKIP]

* bugfix in test [CI SKIP]

* Update docs for new constants [CI SKIP]

* Fix outdated instructions [CI SKIP]

* Do C++11 check for new constants.

* Update constants.qbk [CI SKIP]

* Hopefully green up build

* Constants still *work* in C++03, but now they must be tested in C++11 mode.

* Remove boost::math::isnan.

* Test file requires C++17.
2020-06-04 21:57:38 -04:00
EugeneZelenko
03a879970b Fix Clang -Wextra-semi-stmt and Clang-tidy readability-simplify-boolean-expr warnings. (#360) 2020-05-31 12:43:06 -04:00
NAThompson
646005eaca Take care of overflow. [CI SKIP] 2020-05-31 11:35:46 -04:00
Nick
1186f1a7ff rsqrt (#361)
* rsqrt

* Link docs into math.qbk. [CI SKIP]

* Demo performance with a compiler that generates good instructions [CI SKIP]
2020-05-30 22:34:56 -04:00
Nick
9a45e6a358 AGM 2020-05-29 21:50:25 -04:00
Nick
37fe3f415a Fix ulps plot for float128 and higher precision types. 2020-05-25 16:27:20 -04:00
Nick
9520fb1e4c Merge branch 'develop' of https://github.com/boostorg/math into develop 2020-05-25 16:10:56 -04:00
Nick
15ff6fa3a2 Update ulps_plot to work with mpfr and float128. 2020-05-25 16:10:49 -04:00
Nick
3c3217d2cd Remove some internal dependencies for Daubechies wavelets. (#356) 2020-05-20 14:07:19 -04:00
Edward Diener
6d678efbf7 Change __BORLANDC__ to BOOST_BORLANDC and __CODEGEARC__ to BOOST_CODEGEARC, which is defined in Boost config for the Embarcadero non-clang-based compilers. (#345) 2020-05-06 11:46:51 -04:00
NAThompson
cd1fe84134 Change default number of points to 1000 [CI SKIP] 2020-04-29 10:24:22 -04:00
Nick
47e61a447c ULP plots (#341)
ULPs plots
2020-04-25 09:03:49 -04:00
Nick
c59659f4ed Reinch's modification to Clenshaw recurrence (#339)
* Reinch's modification to Clenshaw recurrence. [CI SKIP]

* Convert Chebyshev tests to math_unit_test.hpp

* Performance of translated Chebyshev Clenshaw recurrence. [CI SKIP]

* Prepare to use modified Clenshaw recurrence in Chebyshev transform.

* Remove unused headers from Chebyshev transform test [CI SKIP]

* Update Chebyshev transform tests to use math_unit_test.hpp
2020-04-25 09:01:05 -04:00
jzmaddock
904138c725 Merge pull request #340 from boostorg/issue321
Correct behaviour of ellint_2 when k = 1.
2020-04-23 15:02:23 +01:00
jzmaddock
d62ab936c9 cyl_bessel_i: Fix variable multiprecision case, plus decimal number case. 2020-04-23 08:47:04 +01:00
jzmaddock
0cc85253e2 Merge pull request #333 from boostorg/better_arg_promotion
Better argument promotion for float_next
2020-04-10 11:52:43 +01:00
jzmaddock
1ba3c0110e Correct behaviour of ellint_2 when k = 1.
Fixes https://github.com/boostorg/math/issues/321.
2020-04-08 09:20:38 +01:00
jzmaddock
fd842536c9 Revert commits requiring C++11 and backport float_distance to C++03 for now. 2020-04-07 17:17:29 +01:00
jzmaddock
bc6667127d Tweak performance tuning macros. 2020-04-04 09:58:20 +01:00
jzmaddock
b48cdffd1e Improve C++03 deprecation diagnostics
So we can see which macro is triggering the warning.
2020-04-02 14:59:16 +01:00
Nick
00707a8b02 float_distance: Should work now . . . 2020-03-29 10:45:24 -04:00
Nick
e3fd9b46fd Better argument promotion for float_next 2020-03-28 17:05:41 -04:00
jzmaddock
49dfd1f535 Move C++03 deprecation warnings to separate file and only warn for headers that need it. 2020-03-26 18:15:53 +00:00
jzmaddock
8b3393091a Daubechies: More code simplification. 2020-03-23 18:23:32 +00:00
Nick
2c85c98982 Document wavelet transform. Submit (mildly) failing unit test for transforms. [CI SKIP] 2020-03-22 20:15:10 -04:00
Nick
0f7cb98188 Tests for wavelet transform [CI SKIP] 2020-03-22 17:15:22 -04:00
Nick
3a34827563 Copyright statements. [CI SKIP] 2020-03-22 13:10:37 -04:00
Nick
fb26bc0cf1 Fix septic hermite evaluation. 2020-03-22 13:03:48 -04:00
Nick
2af33f2725 Fix quintic hermite interpolation [CI SKIP] 2020-03-22 12:07:05 -04:00
Nick
5cbfdb554a Fix invalid read in cubic Hermite. [CI SKIP] 2020-03-22 11:22:36 -04:00
Nick
bc70b99553 Test boundaries for segfaults [CI SKIP] 2020-03-22 08:50:21 -04:00
Nick
b1ba02e5c1 Merge branch 'develop' into daubechies_attempt_2 [CI SKIP] 2020-03-22 08:18:12 -04:00
jzmaddock
3610dd94dd Simplify some of the Daubechies code.
[CI SKIP]
2020-03-22 11:05:06 +00:00
jzmaddock
5b1ba3bd73 Suppress msvc warnings. 2020-03-22 10:12:29 +00:00
Nick
11c45c0ec0 Accept b<= a in quadrature. 2020-03-21 09:22:41 -04:00