llvm-project/libcxx/test
Atmn Patel 51b78a3e06 [libc++] Bugfix to std::binomial_distribution<int>
The current implementation of binomial_distribution is not guaranteed to
converge for certain extreme configurations of the engine and distribution.
This is due to a mistake in the implementation of the algorithm from the
given reference paper. The algorithm in the paper is guaranteed to
terminate but has redundant statements. The current implementation
simplified away the redundancy into a while loop, but it excludes the
return condition of the case where a good sample cannot be returned for
the particular sample being used from the uniform distribution, which is
what causes the infinite loop. This change guarantees termination by
recognizing that a good sample cannot be returned and returning 0 after
breaking the loop. This is also in contrast to the paper because the
return value as specified in the paper violates basic checks in at least
a subset of the extreme cases where the current implementation fails to
terminate. This default return value of 0 is satisfactory for the
extreme case known so far.

Since this is only meant to affect extreme cases where the algorithm
does not terminate anyways, the behavior is expected to remain exactly
the same for all non-extreme cases that have been terminating so far.

Fixes https://llvm.org/PR44847

Differential Revision: https://reviews.llvm.org/D74997
2020-03-17 15:56:16 -04:00
..
libcxx [libc++] Properly mark std::function as deprecated in C++03 2020-03-10 17:45:39 -04:00
pretty_printers [libcxx] Add a std::string_view pretty printer for libcxx. 2020-01-29 13:04:29 -05:00
std [libc++] Bugfix to std::binomial_distribution<int> 2020-03-17 15:56:16 -04:00
support Implement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL 2020-03-16 09:50:23 -07:00
CMakeLists.txt Revert "[libcxx] Force-cache LIBCXX_CXX_ABI_LIBRARY_PATH" 2020-02-03 11:03:58 +01:00
lit.cfg Allow site-specific test_exec_root. 2020-03-13 12:23:49 -07:00
lit.site.cfg.in [libcxx] Codesign test executables if necessary 2019-09-05 21:24:23 +00:00
nothing_to_do.pass.cpp force the bots to cycle 2019-05-09 02:34:37 +00:00