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

Complex pow numerics at zero #1033

Open
axch opened this issue Aug 25, 2022 · 0 comments
Open

Complex pow numerics at zero #1033

axch opened this issue Aug 25, 2022 · 0 comments

Comments

@axch
Copy link
Collaborator

axch commented Aug 25, 2022

pow (MkComplex 0. 0.) (MkComplex 2. 0.)

produces NaNs, even though the answer is 0.

Should we

  • Special-case zero base to return 0? In this case, we should also special-case 0^0 for complex numbers to be 1? Such special cases are relatively cheap on CPU, because CPUs swing through branchy code like monkeys; but a GPU interacts with branches more like an elephant.
  • Special-case integer powers to use multiplication (maybe with some type-level trick to avoid runtime dispatch)? (But can we even implement the O(log(power)) algorithm?)
  • Leave it the way it is and let users work around it themselves?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant