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

2390 Commits

Author SHA1 Message Date
Nick Thompson
3bf7d9791c Use math_unit_test.hpp to fix build failure
We often see the condition number test failing with

```
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: ..\..\..\bin.v2\libs\math\test\condition_number_test.test\a7486d3baaf381a6d13710dc26b7b123\condition_number_test.o: too many sections (32989)
C:\Users\RUNNER~1\AppData\Local\Temp\ccuI2rpi.s: Assembler messages:
C:\Users\RUNNER~1\AppData\Local\Temp\ccuI2rpi.s: Fatal error: can't write 155 bytes to section .text of ..\..\..\bin.v2\libs\math\test\condition_number_test.test\a7486d3baaf381a6d13710dc26b7b123\condition_number_test.o: 'File too big'
```

Use math_unit_test.hpp to fix this.
2024-02-09 15:32:35 -08:00
Nick Thompson
222d266048 CMA-ES 2024-02-09 12:09:53 -08:00
jzmaddock
cbf6b96a09 Merge pull request #1079 from boostorg/issue1075
Update pre-computed constexpr Gauss and Gauss-Kronrod constants
2024-02-09 12:28:23 +00:00
jzmaddock
04c2c248df BOOST_ASSERT->BOOST_MATH_ASSERT. 2024-02-06 09:54:49 +00:00
jzmaddock
a57fb0a894 Reinstate root finding protection against huge jumps.
Apply error handling more rigorously to any root finding client.
Mark evaluation_error's as not reachable for code coverage.
Fixes https://github.com/boostorg/math/issues/184.
2024-02-05 19:16:33 +00:00
jzmaddock
c5feae34bb Simplify tables of constants in gauss and gauss_kronrod code.
Also mark up anything that uses BOOST_MATH_HUGE_CONSTANT as unreachable by code coverage as gcov seems to have an issue with it.
2024-02-02 18:48:57 +00:00
jzmaddock
b2b839ab4c Try and fix Mingw gcc-8 failures. 2024-02-01 20:05:58 +00:00
jzmaddock
c35f12c1f5 Update pre-computed constexpr Gauss and Gauss-Kronrod constants
to always store literal types.
Fixes: https://github.com/boostorg/math/issues/1077.
2024-02-01 18:43:41 +00:00
Nick
ca29a700f1 Remove warnings from naive Monte Carlo (#1075) 2024-01-30 14:28:17 -08:00
Nick
fccad84bf5 Random search (#1071) 2024-01-24 17:26:24 -08:00
Nick
a1f7a305ee Algorithm jSO (#1065)
Follows: Brest, Janez, Mirjam Sepesy Maucec, and Borko Boskovic. "Single objective real-parameter optimization: Algorithm jSO." 2017 IEEE congress on evolutionary computation (CEC). IEEE, 2017.
2024-01-22 14:06:52 -08:00
Nick
de9a1a0ee5 Fix race conditions in differential evolution (#1063)
Through a combination of silly mistakes, I missed a pile of race conditions in the OpenMP threading.

Switch to C++ threading. Note that this change requires serial generation of trial vectors.

Hopefully I can figure out to parallelize the generation of trial vectors to reduce the serial section a la Ahmdahl's law,
while simultaneously keeping thread sanitizer happy.
2024-01-17 10:20:41 -08:00
Nick
4ee83916c5 Differential evolution (#1062)
* Differential evolution

---------

Co-authored-by: Matt Borland <matt@mattborland.com>
2024-01-01 17:09:16 -08:00
Matt Borland
de67ad3207 Rename our components 2023-12-22 05:09:32 -05:00
Matt Borland
23d54b385b Fix for msvc defining _Complex_I in complex.h 2023-12-21 07:20:24 -05:00
Nick Thompson
185bb52813 Remove last usage of boost::array
Now that boost.math is C++14, remove boost::array in order to improve orthogonality of the library.
2023-12-19 17:16:39 -08:00
Nick
e0c17f6856 Improve accuracy of quartic_roots (#1056) 2023-11-27 17:52:56 +01:00
Matt Borland
0c5b957300 Merge pull request #1051 from boostorg/1048
Fix for issue 1048
2023-11-17 10:59:10 +01:00
Matt Borland
6c5fd09a40 Fix ADL failures for __float128 2023-11-17 08:20:05 +01:00
Matt Borland
2cb550d65e Replace C style asserts with BOOST_MATH_ASSERT 2023-11-16 11:39:53 +01:00
Matt Borland
6aaba2e5a3 Add 1 / eps test case to be sure 2023-11-16 11:28:39 +01:00
Matt Borland
8da51f2bde Add test values from issue 2023-11-16 11:26:15 +01:00
Matt Borland
de64f02ad3 Add test case 2023-11-16 09:38:01 +01:00
Matt Borland
bfa206d12c Losen tolerance on cohen acceleration 2023-11-03 08:18:03 +01: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
7571fc6814 Fix up PP logic for there being no __float128. 2023-10-18 09:42:09 +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
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
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
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
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
ryanelandt
3d8e1d5362 test fix for multiprecision 562 (#1015) 2023-08-23 09:17:45 -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
c62682b1a6 Update kolmogorov quantile newton ub to 1 (#1002) 2023-07-31 10:19:42 -04:00
Matt Borland
8bb0d164f2 Merge pull request #978 from boostorg/cpp23-float
C++23 Floats
2023-06-28 08:02:25 +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
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
ff1a265e45 Add to test_constants 2023-05-31 17:06:05 +02:00
Matt Borland
a7f98dbe00 Add casts to all two argument cmath functions to work around GCC bug
[ci skip]
2023-05-31 15:43:54 +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
6d37555ccc Collected autodiff fixes 2023-05-30 17:25:48 +02:00
Matt Borland
823fcd4cf2 Add test and cast to finite differences 2023-05-30 16:46:23 +02:00
Matt Borland
29fbc5b059 Add tests for issue 18511 2023-05-23 12:38:39 +02:00
Matt Borland
54b172236d Fix stack overflow 2023-05-23 12:00:49 +02:00
Matt Borland
f968bec20f Replace 32 bit unsigned with 64 bits 2023-05-23 10:52:50 +02:00
Matt Borland
d1bd7b6f80 Add casting and tests 2023-05-22 14:50:12 +02:00