2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-29 07:42:11 +00:00
Commit Graph

3167 Commits

Author SHA1 Message Date
Matt Borland
d18964d5aa Check update of xterm for denom of 0 2023-11-16 09:38:11 +01:00
jzmaddock
90c509398b Improve error detection further. 2023-11-06 09:40:26 +00:00
jzmaddock
d7048ecfa7 Improve ccmath support detection.
See discussion in https://github.com/boostorg/math/pull/1045.
2023-11-05 19:32:33 +00:00
jzmaddock
21230d698e Correct header include order for standalone mode. 2023-11-03 18:46:23 +00:00
jzmaddock
6d6b0a8c82 Correct new headers include guards. 2023-11-03 18:37:33 +00:00
jzmaddock
7f39320b8d Update/improve ccmath configuration. 2023-11-03 18:32:21 +00:00
Matt Borland
d298a15b1d Reorder macro and add missing include 2023-11-03 08:27:30 +01:00
jzmaddock
ae6571af58 Qualify log1p calls.
This fixes ambiguous overloads in the multiprecision case between boost::multiprecision and boost::math versions of log1p.
See https://github.com/boostorg/multiprecision/pull/568#issuecomment-1790195318
2023-11-02 12:14:06 +00:00
ryanelandt
2c74b149b0 has_denorm_now (#1029)
* initial commit

* remove == std::denorm_present

* remove extra ) in ccmath/next
2023-10-30 09:37:29 +01:00
jzmaddock
c6f4a88809 Incorporate cast simplifications from https://github.com/boostorg/math/pull/880
Add tests and make sure everything is covered, and fix resulting errors.
2023-10-17 17:09:44 +01:00
Rose
0e3b29f389 ten should be a constexpr as a float
Its int counterpart is a constexpr, and the ten variable never changes, so for consistency, we should make float_type ten constexpr as welll.
2023-10-15 18:54:03 -04:00
jzmaddock
eaf876c81e Correct non-central-t series convergence bug.
Fixes https://github.com/boostorg/math/issues/1035.
See also https://github.com/scipy/scipy/issues/19348.
Accuracy in left tail is still poor, and the reflection formula appears to be to blame as it's use causes the series to cancel out the first term, but it appears we have no real choice in the matter here.  At least we do now get a few digits correct.
2023-10-13 18:45:03 +01:00
jzmaddock
57b09f4919 More test cases and corrections. 2023-10-12 17:06:37 +01:00
jzmaddock
2dbd7698cc Adjust recursion when using the Bessel function approximation with large z.
Avoids hitting tgamma on a negative integer, also improves accuracy when b-a-0.5 is close to a negative integer.
Fixes https://github.com/boostorg/math/issues/1034.
2023-10-11 11:45:33 +01:00
AtariDreams
1722ef9261 k should be size_t (#1031) 2023-09-30 18:51:27 -07:00
jzmaddock
2d9d202ff1 Fix conceptual failures. 2023-09-01 17:21:25 +01:00
jzmaddock
8ff6bc114e Avoid spurious overflow and divide by zero in ibeta.
Add tests extracted from SciPy bug report.
Fixes https://github.com/boostorg/math/issues/1006.
See also https://github.com/boostorg/math/pull/1009.
2023-09-01 15:48:43 +01:00
jzmaddock
469bff7e17 Improve method selection logic in ibeta_power_terms
(Sterling version)
2023-08-31 12:36:19 +01:00
jzmaddock
0c4fc70036 Merge branch 'develop' into pr1007
Fixes Conflicts:
	test/test_binomial.cpp
2023-08-30 11:53:29 +01:00
jzmaddock
d967bf73d0 Improve accuracy in ibeta power terms usig Sterling's approximation (the non Lanczos case).
Completes work started here: https://github.com/boostorg/math/pull/1007
2023-08-30 11:50:28 +01:00
Matt Borland
0d941f0d07 Fix issue #1023 (#1024) 2023-08-28 13:10:58 -04:00
Jimmy Lu
74bb4bccf2 Fix inverse_discrete_quantile for large guess (#1007)
If `guess` passed to `inverse_discrete_quantile` cannot be represented
as floating point number, it is possible that `guess + 1` or `guess - 1`
does not change the value at all and we are stuck in infinite loop
inside `round_to_floor` or `round_to_ceil`.  Fix this by
increase/decrease more than 1 in these cases.

Example code to reproduce this:
```c++
boost::math::binomial_distribution<> dist(9079765771874083840, 0.561815);
boost::math::quantile(dist, 0.0365346);
```
2023-08-24 08:31:37 -04:00
Christopher Kormanyos
7b37e2378b Eliminate unused parameter 2023-08-22 19:35:53 +02:00
Christopher Kormanyos
4c964bb2ec Agree on PP syntax for <stdfloat> query 2023-08-22 15:07:22 +02:00
Christopher Kormanyos
320d6f8ab7 Use elementary yet more-obscure PP checks 2023-08-22 11:28:28 +02:00
Christopher Kormanyos
56b71a77c0 MSVC 14_0 stdndards and has-include corrections 2023-08-22 11:09:43 +02:00
John Maddock
f7e94ac22c Merge branch 'fix-inverse_discrete_quantile' of https://github.com/Yuhta/boost-math into pr1007 2023-08-19 12:37:40 +01:00
Ryan
4508717de6 fix unused abterm1 compile warnings 2023-08-18 16:20:15 -04:00
Jimmy Lu
ee80892282 Fix inverse_discrete_quantile for large guess
If `guess` passed to `inverse_discrete_quantile` cannot be represented
as floating point number, it is possible that `guess + 1` or `guess - 1`
does not change the value at all and we are stuck in infinite loop
inside `round_to_floor` or `round_to_ceil`.  Fix this by
increase/decrease more than 1 in these cases.

Example code to reproduce this:
```c++
boost::math::binomial_distribution<> dist(9079765771874083840, 0.561815);
boost::math::quantile(dist, 0.0365346);
```
2023-08-05 12:53:30 -04:00
ryanelandt
50ef83a47b only solve problems if have enough precision (#1004) 2023-07-31 10:36:29 -04:00
ryanelandt
c62682b1a6 Update kolmogorov quantile newton ub to 1 (#1002) 2023-07-31 10:19:42 -04:00
ryanelandt
fb0af63f2a update beta error messages and checks (#1003) 2023-07-31 09:54:33 -04:00
ryanelandt
281f491bd0 use identities for 0(0th) fib convention (#1001) 2023-07-25 09:55:24 -07:00
Matt Borland
8bb0d164f2 Merge pull request #978 from boostorg/cpp23-float
C++23 Floats
2023-06-28 08:02:25 +02:00
Matt Borland
851b357615 Fix pessimization on unaffected platforms 2023-06-27 16:03:43 +02:00
jzmaddock
0a014fd5ca Fix for expression template use in chebyshev.hpp. 2023-06-21 08:56:02 +01:00
Matt Borland
b57749d9c3 Fix casting errors 2023-06-20 12:01:47 +02:00
Matt Borland
e62a284b44 Fix multiprecision failures 2023-06-19 09:36:29 +02:00
Rasmus Henningsson
0852c16a2a median_absolute_deviation bug fix for non-zero center (#997)
Fix bug causing median_absolute_deviation to return incorrect values
when a non-zero center (such as median which is the default) was used.
2023-06-19 09:18:15 +02:00
Matt Borland
0117f4a3fc Fix multiprecision concept failure 2023-06-16 16:40:22 +02:00
Matt Borland
37df734491 Add integer exponent function to chebyshev detail 2023-06-16 16:00:30 +02:00
Matt Borland
7a0e8e02ed More casting of pow 2023-06-16 10:42:22 +02:00
Nick
7887d43f83 Numerical evaluation of Fourier transform of Daubechies scaling funct… (#921)
* Numerical evaluation of Fourier transform of Daubechies scaling functions.

* Update example/calculate_fourier_transform_daubechies_constants.cpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Update example/fourier_transform_daubechies_ulp_plot.cpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Update include/boost/math/special_functions/fourier_transform_daubechies_scaling.hpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Update include/boost/math/special_functions/fourier_transform_daubechies_scaling.hpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Rename include file to reflect it implements both the scaling and wavelet.

* Add performance to docs.

* Update test/math_unit_test.hpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Add boost-no-inspect to files with non-ASCII characters.

---------

Co-authored-by: Matt Borland <matt@mattborland.com>
2023-06-13 08:05:00 -07:00
Matt Borland
f51e1b985d Disable numeric_limits specialization for GCC-14 2023-06-07 15:42:02 +02:00
Matt Borland
677f3b6582 Collected fixes for test_autodiff_8
[ci skip]
2023-06-05 15:17:54 +02:00
Matt Borland
bc9d4b1218 Fix failures and warnings in test_autodiff_6 2023-06-05 14:25:07 +02:00
Matt Borland
a6bc6c7c80 Add <stdfloat> constructor to real_concept 2023-06-05 14:21:53 +02:00
Matt Borland
b66264fa90 Collected special functions warning fixes
[ci skip]
2023-05-31 14:34:10 +02:00
Matt Borland
7a66a98f88 Fix for autodiff 3 2023-05-31 09:32:56 +02:00
Matt Borland
ae56ab203f Fix conversion errors in digamma 2023-05-31 09:24:03 +02:00