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 c30e840
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rand_distr/src/cauchy.rs
Original file line number Diff line number Diff line change
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, 9.0, &[16.458258, -9.859674, 1.9119415, 1.14462]);
}
}

0 comments on commit c30e840

Please sign in to comment.