Skip to content

Commit

Permalink
rand_distr: work around tan func issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Sep 15, 2019
1 parent 802ba8f commit 91bacaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rand_distr/src/cauchy.rs
Expand Up @@ -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(15f32, 10.0, &[22.175842, -7.066305, 6.0132685, 5.1606884]);
}
}

0 comments on commit 91bacaf

Please sign in to comment.