Skip to content

Commit 9788995

Browse files
authored
Merge pull request #894 from dhardy/master
Disable value_stability test for 32-bit Cauchy distr
2 parents 64a4000 + d24afa7 commit 9788995

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rand_distr/src/cauchy.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ use crate::utils::Float;
1818
/// This distribution has a density function:
1919
/// `f(x) = 1 / (pi * scale * (1 + ((x - median) / scale)^2))`
2020
///
21+
/// Note that at least for `f32`, results are not fully portable due to minor
22+
/// differences in the target system's *tan* implementation, `tanf`.
23+
///
2124
/// # Example
2225
///
2326
/// ```
@@ -130,11 +133,10 @@ mod test {
130133
assert_eq!(buf, expected);
131134
}
132135

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.
136136
test_samples(100f64, 10.0, &[77.93369152808678, 90.1606912098641,
137137
125.31516221323625, 86.10217834773925]);
138-
test_samples(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]);
138+
// Unfortunately this test is not fully portable due to reliance on the
139+
// system's implementation of tanf (see doc on Cauchy struct).
140+
// test_samples(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]);
139141
}
140142
}

0 commit comments

Comments
 (0)