#19964: tight complex interval inverse
-------------------------------------+-------------------------------------
       Reporter:  mmarco             |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.2
      Component:  numerical          |   Resolution:
       Keywords:  interval, root     |    Merged in:
        Authors:  Miguel Marco       |    Reviewers:  Vincent Delecroix
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/19964                 |  d57fee2259bf69d0f0471f1bc89c3a81f1e12e27
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by mmezzarobba):

 lgtm except that I'd suggest the following change in order to really test
 all possible cases:
 {{{
 @@ -1130,12 +1130,15 @@ cdef class
 ComplexIntervalFieldElement(sage.structure.element.FieldElement):
          Check that the code is valid in all regions of the complex
 plane::

              sage: rats = [15423/906, 337/59976, 145151/145112]
 -            sage: for a in rats:
 -            ....:     for b in rats:
 -            ....:         x = CIF(a, b)
 -            ....:         assert (x * (~x) - 1).contains_zero()
 -            ....:         x = -CIF(a,b)
 -            ....:         assert (x * (~x) - 1).contains_zero()
 +            sage: ivs = [RIF(aa, bb) for a in rats for b in rats
 +            ....:                   for aa in [-a, a] for bb in [-b, b]
 +            ....:                   if aa <= bb]
 +            sage: for x in ivs:
 +            ....:     for y in ivs:
 +            ....:         z = CIF(x, y)
 +            ....:         inv = ~z
 +            ....:         assert ((z*inv - 1).contains_zero()
 +            ....:                 or z.contains_zero() and
 inv.real().is_NaN())
 }}}

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

Reply via email to