#16439: Allow inverse trig functions to all take complex input
-------------------------------------+-------------------------------------
       Reporter:  kcrisman           |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.3
      Component:  symbolics          |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/ppurka/allow_inverse_trig_functions_to_all_take_complex_input|  
c4ba30d802f932b29205ec3f49f3eeeeb0942e76
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ppurka):

 Replying to [comment:9 kcrisman]:
 > Anyway, then it goes to the `arcsin()` ''method'' in
 sage.symbolic.expression.Expression (!) because now we have a symbolic
 expression for the previously `complex` input.  And I'm pretty sure that
 this is where things go wrong, because
 [http://git.sagemath.org/sage.git/tree/src/sage/symbolic/pynac.pyx#n1596
 here] it looks like it tries to coerce our now-symbolic thing to `RR`,
 which of course we can't do.

 Ah. I didn't figure out this step. I understood that it goes into
 `Function`, but lost track from there.

 > The reason your fix for the other arc trig functions works is because
 they are not defined in Ginac/Pynac.  But these functions don't work with
 complex input, presumably because
 [http://www.ginac.de/reference/inifcns__trans_8cpp_source.html#l00642
 here] it doesn't handle complex stuff, or maybe because when we replaced
 Ginac's internal numbers with Sage ones something happened.

 Yes. I know. These functions have their own `_evalf_` method which gets
 executed finally. What is weird is that there are some other functions
 like `sec`, `csc`, etc, which also have an `_evalf_` method, but that
 method probably never gets called! Instead the `_eval_` method gets
 called. And, somehow that `_eval_` method takes care of `complex` type
 input.

 > Though as you say if we can't get it done quickly enough here, we can do
 this stuff and open a new ticket for it.  But I really don't like that
 coercion to SR of complexes.

 Yes, all this multiple coercion is unclear to me also. `SR` is slow; and
 we should avoid doing those kinds of coercion. The only time when that
 should be done is when `hold=True` is passed as a parameter.

--
Ticket URL: <http://trac.sagemath.org/ticket/16439#comment:11>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to