Skip to content

Commit 91bacaf

Browse files
committed
rand_distr: work around tan func issue
1 parent 802ba8f commit 91bacaf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: rand_distr/src/cauchy.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ mod test {
130130
assert_eq!(buf, expected);
131131
}
132132

133+
// Warning: in a few cases, results vary slightly between different
134+
// platforms, presumably due to differences in precision of system impls
135+
// of the tan function. We work around this by avoiding these values.
133136
test_samples(100f64, 10.0, &[77.93369152808678, 90.1606912098641,
134137
125.31516221323625, 86.10217834773925]);
135-
test_samples(20f32, 10.0, &[27.175842, -2.0663052, 11.013268, 10.160688]);
138+
test_samples(15f32, 10.0, &[22.175842, -7.066305, 6.0132685, 5.1606884]);
136139
}
137140
}

0 commit comments

Comments
 (0)