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

update MPFR to 4.2.0 #48165

Merged
merged 5 commits into from
Jan 10, 2023
Merged

update MPFR to 4.2.0 #48165

merged 5 commits into from
Jan 10, 2023

Conversation

simonbyrne
Copy link
Contributor

Updates MPFR library, and makes use of new trig functions

@giordano giordano added building Build system, or building Julia or its dependencies bignums BigInt and BigFloat JLLs external dependencies Involves LLVM, OpenBLAS, or other linked libraries labels Jan 7, 2023
@giordano
Copy link
Contributor

giordano commented Jan 7, 2023

Should add tests for the new methods?

@simonbyrne
Copy link
Contributor Author

I think it should be covered by tests in test/math.jl, but will check

@simonbyrne
Copy link
Contributor Author

Hmm, looks like not. I'll update them

@PallHaraldsson
Copy link
Contributor

Possibly you want to define e.g. tanpi since it's already implemented there: "mpfr_tanpi, mpfr_acospi, mpfr_asinpi, mpfr_atanpi and mpfr_atan2pi"? It seems trivial to add, for MPFR (though not for Float64).

It's not yet in Base for floats, but [a]tabpi is in C2x standard (and IEEE 754:2019 and C#/dotnet seems to implemente it, issue 20137 there):
https://en.cppreference.com/w/c/experimental/fpext4

https://grouper.ieee.org/groups/msc/ANSI_IEEE-Std-754-2019/background/tanpi.txt

754 and tanPi - exceptionally interesting

754-2008 defined sin, cos, tan, asin, acos, atan, and
atan2, but only sinPi, cosPi, atanPi, and atan2Pi. What
happened to tanPi, asinPi, acosPi? [..]

I see that you want to bring MPFR support in line with Base (floats), to be fully generic, so it's less than ideal to only have some functions for big/MPFR, not regular floats... the opposite problem, but we want to implement those at least eventually. We could actually do it by calling MPFR and then truncate to e.g. Float64? So not fast but could be improved later...

@simonbyrne
Copy link
Contributor Author

I'm just adding methods to functions which are already are defined in Base, and which have corresponding functions that were added to MPFR in this release.

I think adding the additional functions to Base is a good idea, but should be a separate PR

@simonbyrne simonbyrne requested a review from giordano January 9, 2023 18:02
@simonbyrne
Copy link
Contributor Author

Not sure if we want to backport or not?

@oscardssmith
Copy link
Member

why would we backport? This looks to me a lot like a new feature.

@StefanKarpinski
Copy link
Member

Updating the library could be backported but adding methods should not.

@simonbyrne
Copy link
Contributor Author

It doesn't look like there are any important bug fixes: https://www.mpfr.org/mpfr-4.2.0/#changes (their printing fix actually broke our printing, hence the change in this PR)

@StefanKarpinski
Copy link
Member

Wow, all green CI! Haven't seen that recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bignums BigInt and BigFloat building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries JLLs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants