-
-
Notifications
You must be signed in to change notification settings - Fork 641
Closed
Milestone
Description
Same with tan
and imag
:
sage: real(sqrt(sin(x)))
sqrt(abs(sin(x)))*cos(1/2*arctan2(cos(real_part(x))*sinh(imag_part(x)), cosh(imag_part(x))*sin(real_part(x))))
sage: _.subs(x==0)
...
RuntimeError: arctan2_eval(): arctan2(0,0) encountered
SymPy expands similarly but gives NaN on substitution instead of an exception.
This all would not be of concern if not 3d plotting would likely need real/imag parts of a function, their workaround real(...,hold=True)
works perfectly but this is not the general solution that is needed.
One solution would be to return NaN
instead of throwing up.
Depends on #21623
Component: symbolics
Author: Ralf Stephan
Branch/Commit: fda5183
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/21614