Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what to do with setrounding? #26935

Closed
simonbyrne opened this issue Apr 30, 2018 · 10 comments · Fixed by #27166
Closed

what to do with setrounding? #26935

simonbyrne opened this issue Apr 30, 2018 · 10 comments · Fixed by #27166

Comments

@simonbyrne
Copy link
Contributor

Although marked as experimental in the docs, it still triggers a lot of issues (#17926, #26801, #26934). Perhaps we should unexport it, or deprecate it all together (functionality could be moved to a package).

cc: @dpsanders

@dpsanders
Copy link
Contributor

Moving it to a package sounds reasonable.
We have effectively almost removed the dependence on setrounding in IntervalArithmetic.jl, at least for Float64, which was possibly its biggest consumer?

@dpsanders
Copy link
Contributor

Basically rounding seems to be completely broken on Windows.

@JeffreySarnoff
Copy link
Contributor

(a) unexport setrounding (b) eventually favor rounding mode savvy mathops

@JeffreySarnoff
Copy link
Contributor

Earlier this year, I wrote DirectedRoundings.jl. This is a small package that intends to make making good use of directing rounding directions. The approach there lets setrounding do much of this governed crunching ... leaving to us the higher order engagements. With the apparent sidelining of reliable and portable and subtype specific setrounding, do we have any winning way waiting?

simonbyrne added a commit that referenced this issue May 18, 2018
Fixes #26935.

This is the "minimal" change of deprecating Float32/Float64 support.
JeffBezanson pushed a commit that referenced this issue May 29, 2018
Fixes #26935.

This is the "minimal" change of deprecating Float32/Float64 support.
@dpsanders
Copy link
Contributor

I recently realised that this has negative consequences for MPFR, where the rounding is done in software and so works on any machine.

Perhaps it is enough to have MPFR.setrounding for that case?

@JeffreySarnoff
Copy link
Contributor

I have found MPFR (as seen through our BigFloat) to be unreliable in the last digit. Using setrounding with BigFloat may be not entirely ok. I have not done any testing on that -- I have done some to see that the last digit is not always rounded to nearest (when no other setrounding is in use). It has made verifying development code in the new Arb package difficult.

@simonbyrne
Copy link
Contributor Author

@JeffreySarnoff do you have an example?

@simonbyrne
Copy link
Contributor Author

@dpsanders I intentionally kept setrounding to work for MPFR. But we could move it to the module.

@dpsanders
Copy link
Contributor

@simonbyrne Thanks, I just realised that setrounding still worked for BigFloat.
It would seem sensible to move it to the module. Maybe it would make sense to change the module name to BigFloats?

@JeffreySarnoff
Copy link
Contributor

I have no example, and no specific details. I was testing some extended precision trig or arctrig functions and using BigFloat values for comparison -- one test failed and I tracked it back to BigFloat's value after redoing the work in Maple. At the time, frustration and recordkeeping/filesaving were at odds. The only detail I recall is 3 days of yuck.

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 a pull request may close this issue.

3 participants