#3979: Power series composition messes up precision
--------------------------------------------------------+-------------------
       Reporter:  kedlaya                               |         Owner:  
somebody                                
           Type:  defect                                |        Status:  
needs_review                            
       Priority:  critical                              |     Milestone:  
sage-5.3                                
      Component:  algebra                               |    Resolution:        
                                  
       Keywords:  power series, composition, precision  |   Work issues:        
                                  
Report Upstream:  N/A                                   |     Reviewers:  Kiran 
Kedlaya, Luis Felipe Tabera Alonso
        Authors:  Francis Clarke                        |     Merged in:        
                                  
   Dependencies:                                        |      Stopgaps:  12783 
                                  
--------------------------------------------------------+-------------------

Old description:

> The composition of two power series is sometimes returned with the wrong
> precision. A trivial example:
>
> {{{
> sage: pow.<u> = PowerSeriesRing(Rationals()); print (1 + O(u^4))(u)
> 1
> }}}
> where the return value should have precision 4 rather than infinity. A
> more nontrivial example:
>
> {{{
> sage: pow.<u> = PowerSeriesRing(Rationals()); print (1 + u^2 +
> O(u^4))(u^2)
> 1 + u^4 + O(u^10)
> }}}
> where the return value should have precision 8 instead of 10.
>
> ----
>
> Apply only [attachment:trac_3979_power_series_substitution_rev4.patch]

New description:

 The composition of two power series is sometimes returned with the wrong
 precision. A trivial example:

 {{{
 sage: pow.<u> = PowerSeriesRing(Rationals()); print (1 + O(u^4))(u)
 1
 }}}
 where the return value should have precision 4 rather than infinity. A
 more nontrivial example:

 {{{
 sage: pow.<u> = PowerSeriesRing(Rationals()); print (1 + u^2 +
 O(u^4))(u^2)
 1 + u^4 + O(u^10)
 }}}
 where the return value should have precision 8 instead of 10.

 ----

 Apply [attachment:trac_3979_power_series_substitution_rev4.patch] followed
 by  [attachment:trac_3979_power_series_substitution_rev4_extra.patch]

--

Comment (by fwclarke):

 Replying to [comment:21 chapoton]:
 > I would like to see, when possible, a more specific error instead of
 > {{{
 > raise ValueError, "Cannot substitute this value"
 > }}}
 > In particular, when this is because of negative valuation, one should
 say it.

 A good point.  The new patch (to be applied after
 trac_3979_power_series_substitution_rev4.patch) gives a more explicit
 error message.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/3979#comment:22>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to