File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ run test_beta_simple.cpp ;
18
18
run test_cbrt.cpp ;
19
19
run test_sign.cpp ;
20
20
run test_round.cpp ;
21
+ run test_expm1_simple.cpp;
Original file line number Diff line number Diff line change
1
+ // Copyright Matt Borland 2024.
2
+ // Use, modification and distribution are subject to the
3
+ // Boost Software License, Version 1.0. (See accompanying file
4
+ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ #include < random>
7
+ #include < cmath>
8
+ #include < boost/math/special_functions/expm1.hpp>
9
+ #include " math_unit_test.hpp"
10
+
11
+ constexpr int N = 50000 ;
12
+
13
+ template <typename T>
14
+ void test ()
15
+ {
16
+ std::mt19937_64 rng (42 );
17
+ std::uniform_real_distribution<T> dist (0 , 0.01 );
18
+
19
+ for (int n = 0 ; n < N; ++n)
20
+ {
21
+ const T value (dist (rng));
22
+ CHECK_ULP_CLOSE (std::expm1 (value), boost::math::expm1 (value), 10 );
23
+ }
24
+ }
25
+
26
+ int main ()
27
+ {
28
+ test<float >();
29
+ test<double >();
30
+
31
+ return boost::math::test::report_errors ();
32
+ }
You can’t perform that action at this time.
0 commit comments