-
-
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
Replace log2 and log10 with Julia ports. #27137
Conversation
pkofod
commented
May 17, 2018
•
edited
Loading
edited
- fix license
- add tests
- consider moving all sorts of helper functions (highword, zero_out_lowword) up in the file tree so they're not scattered around in various files.
base/special/log.jl
Outdated
_log1p_t2(w::Float32) = @horner(w, lg1, lg3) | ||
_log1p_t2(w::Float64) = @horner(w, Lg1, Lg3, Lg5, Lg7) | ||
""" | ||
_log1p(f::Union{Float32, Float64}) |
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.
This docstring mentions _log1p
but the method is called k_log1p
.
I've tweaked this a bit to use generic interface for arbitrary-base logs. This should provide a good base for improving the accuracy of arbitrary bases (#18298). Combined with the recent optimiser changes, we could make things like |
Bump - can we get this in? |
I’m not in possession of a computer I can dev on until next week |
Bump - in order to get this (and the rest of the libm) things merged, in case we are close enough. |
Bump - would be nice to revive this. |
If the kids cooperate (by falling asleep instead of screaming for random things), I have some time tonight to add the benchmarks and tests. |
@simonbyrne I'm off to bed. Did some benchmarking, and it seems fine (faster even?) but I havn't rebased yet, so I need to make sure it's not because of that. If you have time to run some benchmarks, I'd appreciate it.Also curious if there are any specific values you'd prefer to test against. |
Seems to run a bit faster but I only checked it against 1.0.2 prebuilt binaries, but I did a stupid thing and my system is now building from scratch. >_> |
What do we need to get this merged? |
I've not sure if I ever got around to rebuilding as mentioned above, but given some recent oddities benchmarking these things, I think we should benchmark them once more, and I'd love to have some knowledgeable people looking over my shoulder to make sure that there are no regressions. |
base/special/log.jl
Outdated
# is preserved. | ||
# ==================================================== | ||
|
||
# Constants and utilities |
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.
is this an orphan comment that could be removed?
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.
I tested this, and it works. Is there a reason that we have not merged it?
My test branch:
https://github.com/aminya/julia/tree/log2log10
Bump, would be lovely to get this out of WIP... |
WIP is probably also no longer descriptive... I think the missing step here is proper benchmarking. |
Co-Authored-By: pkofod <patrick.mogensen@gmail.com>
what have i done 😱 edit : went back to my old commit |
I am wondering that if we are redoing this, do we prefer getting the Tang algorithm that is in libm.jl? |
Good question. Since this is essentially sure, I'm not sure it's worth it. I mean we can always try that one after. The main thing to be done here is to test for regressions, but I've not felt confident doing benchmarks on these types of functions in Julia for a while. It's so hard to know if things get inlined/constantfolded/etc. |
#39556 supersedes. |