-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
speed up Ryu.pow5 #46764
speed up Ryu.pow5 #46764
Conversation
My guess would be overflow protection for sufficiently large |
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.
Most of this was a straight port of the code in this repo, so there are probably ways to simplify/clean up (I think @simonbyrne did some of that initially when reviewing).
Do you know if this needs an overflow check? |
I don't off the top of my head |
Maybe run a PkgEval and merge if it looks ok? |
It feels kind of silly to use pkgeval for something this small, but I guess we might as well. |
Or just merge, tests pass after all and I guess we will find it in release PkgEval if it is too bad |
#yolo |
Felt I should look at this since printing numbers incorrectly would be bad. This use of Lines 58 to 66 in f71b839
My reasoning is that Lines 17 to 19 in f71b839
You can see that Lines 152 to 159 in f71b839
Does anyone know what the range of possible values for |
Bump: @oscardssmith, @quinnj do you know about the range of values that |
ah it appears that |
Do you have an example? |
julia> using Printf
julia> @printf "%.8g" 4.645833859177319e63 # master
4.6458338e+63
julia> @printf "%.8g" 4.645833859177319e63 # 1.8
4.6458339e+63 There are two ways that pow5 can be wrong,
For the second case, we need to find a So using |
The current algorithm does up to
p
divisions, while this algorithm does only 1. I've assigned @quinnj to review since I'm not 100% sure that there isn't a very good reason that this function isn't written like this.