#17285: CIF is missing many functions
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  basic arithmetic   |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/17285                 |  dd4cf4e61cbc44485985e1f74de201c87ad06bc9
   Dependencies:  #17130             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:9 jdemeyer]:
 > I don't like the added complexity of having 3 branches in every
 function. Why not just use the generic case everywhere?

 The main reason is to avoid numerical noise (I want the cosine of a real
 number to be a real number). You have
 {{{
 sage: a = CIF(2,0)
 sage: I = CIF.gen()
 sage: ((I*a).exp() + (-I*a).exp()) / 2
 -0.4161468365471424? + 0.?e-16*I
 }}}
 It should be fine to remove the imaginary branch, but then it would be
 less precise
 {{{
 sage: a = CIF(0,2)
 sage: b1 = CIF(0, a.imag().cosh())
 sage: b1.diameter()
 1.33393183261575e-16
 sage: b2 = ((I*a).exp() + (-I*a).exp()) / 2
 sage: b2.diameter()
 2.36079803558624e-16
 }}}

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/17285#comment:10>
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