From c30e840f3f944900a4c8ed4026ef2280770d9f02 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..dc508bc9f4e 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, 9.0, &[16.458258, -9.859674, 1.9119415, 1.14462]); } }