gcc/libstdc++-v3/include
Jonathan Wakely 60d9f25487 libstdc++: Prefer double to long double in std::shuffle_order_engine
The transition algorithm for std::shuffle_order_engine uses long double
to ensure that the value (max() - min() + 1) can be accurately
represented, to avoid bias in the shuffling. However, when the base
engine's range is small enough we can avoid slower long double
arithmetic by using double. For example, long double is unnecessary for
any base engine returning 32-bit values.

This makes std::knuth_b::operator() about 15% faster on x86_64, and
probably even more on targets where long double uses soft-float.

libstdc++-v3/ChangeLog:

	* include/bits/random.h (independent_bit_engine): Fix typo
	in comment.
	(shuffle_order_engine): Fix incorrect description in comment.
	* include/bits/random.tcc (__representable_as_double
	(__p1_representable_as_double): New helper functions.
	(shuffle_order_engine::operator()): Use double for calculation
	if (max() - min() + 1) is representable as double.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
	line number.
2020-10-31 12:54:03 +00:00
..
backward libstdc++: Add deprecated attributes to old iostream members 2020-08-19 12:13:23 +01:00
bits libstdc++: Prefer double to long double in std::shuffle_order_engine 2020-10-31 12:54:03 +00:00
c Update copyright years. 2020-01-01 12:51:42 +01:00
c_compatibility Update copyright years. 2020-01-01 12:51:42 +01:00
c_global libstdc++: Add parentheses around assignments used as truth values 2020-09-10 17:09:16 +01:00
c_std Update copyright years. 2020-01-01 12:51:42 +01:00
debug libstdc++: Fix some warnings in headers 2020-10-29 11:43:55 +00:00
decimal Update copyright years. 2020-01-01 12:51:42 +01:00
experimental libstdc++: Fix some warnings in headers 2020-10-29 22:47:22 +00:00
ext libstdc++: Do not use volatile for __gnu_cxx::rope reference counting 2020-10-29 14:47:17 +00:00
parallel libstdc++: Add compile-time checks to__glibcxx_assert [PR 71960] 2020-09-01 20:52:26 +01:00
precompiled libstdc++: Remove unused header 2020-10-19 11:19:28 +01:00
pstl libstdc++: Rebase include/pstl to current upstream 2020-10-21 06:11:28 -07:00
std libstdc++: Don't initialize from *this inside some views [PR97600] 2020-10-30 20:33:19 -04:00
tr1 libstdc++: Prevent deprecation warnings from <tr1/shared_ptr> 2020-10-29 22:47:22 +00:00
tr2 Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.am libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
Makefile.in libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00