Uh oh!
There was an error while loading. Please reload this page.
Conversation
rgommers
commented
Nov 21, 2022
Sphinx is unhappy with the branch cuts label: |
kgryte
commented
Nov 21, 2022
kgryte
commented
Nov 27, 2022
Now that #461 is merged, all checks for this PR now pass. |
rgommers
left a comment
There was a problem hiding this comment.
Thanks @kgryte. One minor comment on the diff. My main comment is about the branch cuts - it would be very helpful to document that they are consistent with (and based on) those from C99. It is noted in the branch cuts design document, however that is probably easy to miss (and it requires the user to know which functions are in C99 and which aren't). Maybe in a couple of words, "branch cuts for log match those in C99"?.
Uh oh!
There was an error while loading. Please reload this page.
asmeurer
commented
Dec 1, 2022
For functions like this with a branch cut, should we add special cases along the cut, i.e., |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Aaron Meurer <asmeurer@gmail.com>
kgryte
commented
Dec 1, 2022
@asmeurer That should already be covered by https://github.com/data-apis/array-api/pull/514/files#diff-6a52ec5810cf6d5389f09ea49af4311f7dc38da86d9c091e2a0234dfc5f662cbR939. |
asmeurer
commented
Dec 1, 2022
Is it worth specially noting that functions like log, sqrt, etc. are not expected to promote floating-point arguments outside of their real domain to complex (and indeed, such value-based casting is explicitly recommended against)? |
asmeurer
commented
Dec 1, 2022
Did you mean to link to a specific line? I don't see where this is mentioned. |
kgryte
commented
Dec 1, 2022
From your comment, seemed like you were referring to how complex conjugates should be specified. |
kgryte
commented
Dec 1, 2022
Yes, this is likely a good idea. Probably better to include as part of the general complex number design doc. |
asmeurer
commented
Dec 2, 2022
I mean specifically special cases along the cut, for +0 and -0. Something like "If Also, a weird thing I just discovered: |
rgommers
commented
Dec 5, 2022
This comment applies to a large number of open PRs, so I will add it as a separate task in gh-533. |
kgryte
commented
Dec 12, 2022
@asmeurer At the moment, the spec does cover the special cases you mention. Per the guidance in C99 (and also included in this PR), We can see that the equality requirement holds by computing the principal value of the complex logarithm in terms of where In short, I don't think we need to go beyond what this PR already does. Namely, require that |
asmeurer
commented
Dec 13, 2022
Hmm, OK. What about functions whose branch cuts are along the imaginary axis? Anyway, let's make sure this is tested properly when we add it to the test suite (specifically, with +/- 0 being tested) @honno |
asmeurer
commented
Dec 13, 2022
Just to be clear, I'm OK with this PR. My question applies to some other functions, but it's not something that should block things, since it's just about a special case which could easily be added later. |
rgommers
commented
Dec 13, 2022
Thanks @asmeurer for the clarification and the new issue. Looks like we're all good here then. |
This PR
logby documenting special cases. By convention, the natural logarithm has a single branch cut, which is defined as the real interval(-infinity, 0).