From f39915a4964052b1b091ab67d8cff137a848c633 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Sun, 15 Sep 2019 17:43:48 +0100 Subject: [PATCH] rand_distr: work around tan func issue --- rand_distr/src/cauchy.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rand_distr/src/cauchy.rs b/rand_distr/src/cauchy.rs index 8932a8e7787..520b607d6fc 100644 --- a/rand_distr/src/cauchy.rs +++ b/rand_distr/src/cauchy.rs @@ -130,8 +130,11 @@ mod test { assert_eq!(buf, expected); } + // Warning: in a few cases, results vary slightly between different + // platforms, presumably due to differences in precision of system impls + // of the tan function. We work around this by avoiding these values. test_samples(100f64, 10.0, &[77.93369152808678, 90.1606912098641, 125.31516221323625, 86.10217834773925]); - test_samples(20f32, 10.0, &[27.175842, -2.0663052, 11.013268, 10.160688]); + test_samples(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]); } }