Skip to content

Disable value_stability test for 32-bit Cauchy distr - #894

Merged
dhardy merged 1 commit into
rust-random:masterfrom
dhardy:master
Sep 20, 2019
Merged

dhardy merged 1 commit into
rust-random:masterfrom
dhardy:master

Conversation

@dhardy

@dhardy dhardy commented Sep 19, 2019

Copy link
Copy Markdown
Member

This appears not to be stable.

@dhardy
dhardy requested a review from vks September 19, 2019 10:32
@vks

vks commented Sep 19, 2019

Copy link
Copy Markdown
Contributor

I'm not sure we can promise value stability for any distribution involving floating point arithmetic, at least not if transcendental functions are involved, which are not specified by the IEEE-754 standard (see here for details).

@dhardy

dhardy commented Sep 20, 2019

Copy link
Copy Markdown
Member Author

You're right that there are a lot of things that can break value-stable portability of FP operations, but what can we do? I'd prefer to do the best we can (and warn about likely problems) than to give up completely. (I've had some success in the past with double-precision and enforcing SSE.)

However on this particular test I think we should give up: it has yielded different results on Windows, Linux 64-bit and now Linux 32-bit MUSL, though curiously only for f32.

Perhaps we should make additional notes here.

Comment thread rand_distr/src/cauchy.rs
test_samples(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]);
// Unfortunately this test is not fully portable due to reliance on the
// system's implementation of tanf (see doc on Cauchy struct).
// test_samples(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big is the difference? Are you getting completely different values?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's just the last digit of one of the results that differs by 2 or so; insignificant in most regards. Details are in Travis's log.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I would prefer to keep the test and increase the error tolerance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants