#12780: Be more careful about setting the Maxima 'domain'
------------------------------------+---------------------------------------
Reporter: mjo | Owner: burcin
Type: enhancement | Status: closed
Priority: major | Milestone: sage-5.6
Component: symbolics | Resolution: fixed
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Burcin Erocal
Authors: Michael Orlitzky | Merged in: sage-5.6.beta0
Dependencies: #12845 | Stopgaps:
------------------------------------+---------------------------------------
Comment (by kcrisman):
> if {{{x}}} is assumed to be real the correct answer for {{{sqrt(x^2)}}}
is {{{abs(x)}}}.
Again, according to symbolics experts (as opposed to functions experts)
like Fateman, there is no such thing as `abs(x)`, only `x` or `-x`, and
one then chooses a branch - arbitrarily, but consistently. At least, so I
understand that argument.
> However if {{{x}}} is assumed to be complex, the correct answer is
either {{{x}}} or {{{-x}}},
Which is what is given here, since one doesn't know a priori whether `x`
has + or - real part, etc. So Maxima picks `x`.
> more precisely the one with a positive real part (or a nonnegative
imaginary part if the real part is zero). Then if {{{x}}} is non-real the
answer {{{abs(x)}}} is wrong, since this is the norm of {{{x}}}, and the
norm is real. Consider for example {{{x = -3+4*I}}}, whose norm is 5, but
whose square root is {{{3-4*I}}}.
Yes, that's presumably why `domain:complex` does not allow `abs(x)` in
Maxima either. Maybe we need a `csgn` function too, but I don't know
whether Ginac supports this, though
[http://www.ginac.de/reference/classGiNaC_1_1numeric.html#a83d936877f6090cfcac15e59350f4241
apparently it does].
> If this ticket did change the default domain of symbolic variables from
real to complex, this is a **MAJOR** change.
The default domain has been complex for a long, long time. It was just
exposed here that we didn't do that in `simplify_radical` - presumably to
avoid the very behavior you are noticing at #14305, but we must have
forgotten that.
Note also that I am not advocating for a particular resolution here, just
trying to summarize the arguments and previous behavior.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12780#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.