Open rtoy opened 1 month ago
Imported from SourceForge on 2024-07-09 11:16:05 Created by rtoy on 2023-11-09 15:31:39 Original: https://sourceforge.net/p/maxima/bugs/4209/#b07f
What version are you using? In git HEAD, I see
(%i9) sign(atan2(1,%i));
expt: undefined: 0 to a negative exponent.
-- an error. To debug this try: debugmode(true);
Imported from SourceForge on 2024-07-09 11:16:09 Created by willisbl on 2023-11-09 15:53:19 Original: https://sourceforge.net/p/maxima/bugs/4209/#0449
Oh, sorry--that was done using my tweaked but buggy version of compar.lisp
.
But again, if atan2(y,x) = carg(x + %i y)
is an identity, we should have
atan2(1,%i) = carg(%i + %i) = carg(2 %i) = %pi/2
, I think. And that makes sign(atan2(1,%i)) = pos
correct, right?
Imported from SourceForge on 2024-07-09 11:16:12 Created by rtoy on 2023-11-09 22:01:10 Original: https://sourceforge.net/p/maxima/bugs/4209/#c91e
I'm not really sure what the definition of atan2
should be. Is it carg
or the logarc
form. If we use the logarc
form, I get
(%i84) logarc(atan2(1,%i*t));
%i t + %i
(%o84) - %i log(------------)
2
sqrt(1 - t )
(%i85)
The rectform
is then:
(%i91) rectform(%);
Evaluation took 0.0100 seconds (0.0100 elapsed) using 247.898 KB.
2
abs(t + 1) atan2(0, 1 - t )
(%o91) - %i log(--------------) + atan2(t + 1, 0) - ----------------
! 2 ! 2
sqrt(!t - 1!)
It seems as if the imaginary part approaches minf
as t
approaches 1 from below.
Assuming I did this correctly.
The documentation for atan2 needs some work because it's clearly talking about x and y being real values.
Imported from SourceForge on 2024-07-09 11:16:04 Created by willisbl on 2023-11-09 13:21:55 Original: https://sourceforge.net/p/maxima/bugs/4209
Opinions might differ on the correct value for
sign(atan2(1,%i))
, but a user shouldn't get such a message:Notice
If
atan2(y,x) = carg(x + %i y)
is an identity, I claim thatsign(atan2(1,%i)) = pos
is correct.