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

tocomplex and c versions of PDL::Ops that have complex versions #527

Closed
mohawk2 opened this issue Jan 22, 2025 · 1 comment
Closed

tocomplex and c versions of PDL::Ops that have complex versions #527

mohawk2 opened this issue Jan 22, 2025 · 1 comment

Comments

@mohawk2
Copy link
Member

mohawk2 commented Jan 22, 2025

tocomplex (no _ to match topdl) is a need that should be fulfilled. That would then allow r2C to switch to giving an error for complex inputs.

Similarly, I think that some functions should have c versions that have complex outputs. csqrt is a really good one that meets a need, separate from what I fully agree was a real need for csqrt_up. log is another. Are we basically talking about a large chunk of what PDL::Ops provides that should have "treat real as complex" versions, starting with c to distinguish them? Or just trigonometric functions?

Originally posted by @mohawk2 in #524 (comment)

@mohawk2
Copy link
Member Author

mohawk2 commented Jan 22, 2025

@wlmb replied:

Some real functions have a bounded domain, such as log, which is
meaningless as a real function for a negative argument, since the
exponential of any real number is positive, or acos, meaningless for
arguments larger than 1 or smaller than -1, as cos of any real number
is bounded between -1 and 1. However, these functions do have a
meaning when they are interpreted as complex functions of a complex
variable where the complex variable turned out to lie on the real
line. It is for this class of functions, for which I guess a version
with starting 'c' would be useful. I can think of csqrt, clog, cacos and
casin. For example, we wouldn't need a catan, as atan is real for any
real input. We would need catanh as atanh only works in the range -1,1
and we would need cacosh as acosh only works in the range 1,Inf. I'm
not sure about other functions.

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