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 f39915a
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(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]);
}
}

0 comments on commit f39915a

Please sign in to comment.