-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Document BigFloat replacement; ArbFloat #51515
Conversation
is it true that for basic operations |
given that that's not to say that community-driven package curation and recommendation for more niche (and possibly indeed better!) replacements to common tools can't be useful, but I don't think it belongs in |
There are a couple things problematic here.
|
Yes, I believe so, since:
I believe that translates to ArbFloat (or I would be curious if not, and why); and I asked: in addition:
so it's of course much faster with it's default, which can be changed (or for BigFloat).
@JeffreySarnoff, I did not know that, and then I might have toned down the recommendation. Still is -0.0 very valuable? Also ArbNumerics.jl has interval capability, so that package is superior in that way. I think it's very valid to document it as an alternative in some way.
GMP is well know but not used for this (?), only MPFR, still well known. Also ArbLib, at least that underlying C library, if not ArbNumerics.jl? I admit, I have an ulterior motive, I want BigFloat/MPFR gone, for now just suggesting an alternative. If more (know about) and use it, then it will be more practical later.
I think it belongs in Julia's docs, and didn't find anywhere, and looked for a good spot. Do you have a better suggestion for a location? |
There are some benchmarks on mpfr.org, albeit it's quite possible they're outdated (I think they're from 2018): https://www.mpfr.org/mpfr-4.0.1/timings.html |
Technically, it shouldn't be; the only case I can think of is one in which the sign of 0 is used to infer the direction from which the computation approached zero, but, given that this would be highly contextual, one would be better off working from the operands. It is quite likely that unless one has access to both the operands and operators that evaluated to -0.0, it would not be possible to determine how the -0.0 was produced. |
Division is presumably less contrived than copysign: julia> pz = 0.0
0.0
julia> nz = -pz
-0.0
julia> 1/pz
Inf
julia> 1/nz
-Inf There's a big difference between negative and positive infinity. |
Can someone who objected to documenting like I did make an edit suggestion with a language you would be ok with? I think at least something like ArbNumerics.jl is an alternative, with additional features, and in many cases faster. Which operation is faster? I think mul is important (and FMA?), and I see it was close from the benchmark. Other are faster, seemingly not all operations as I thought. But with its default smaller precision then well all operations should be way faster... |
Cool! |
[`BigInt`](@ref) the [GNU Multiple Precision Arithmetic Library (GMP)] | ||
(https://gmplib.org) is used, and for [`BigFloat`](@ref) the | ||
[GNU MPFR library](https://www.mpfr.org/) is used. See also | ||
the [ArbNumerics.jl](https://github.com/JeffreySarnoff/ArbNumerics.jl) package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also Arblib.jl: https://juliahub.com/ui/Packages/General/Arblib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking to another library here is already a bit dubious but at least it is a pure Julia one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both packages wrap the Arb C library: https://juliahub.com/ui/Packages/General/Arb_jll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, then I don't think we need to do this at all.
[skip ci]