To Whom it May Concern:

Per the "Reporting Bugs" procedure 
<https://doc.sagemath.org/html/en/developer/trac.html#reporting-bugs>, I am 
emailing sage-devel@ with a suspected bug. I am happy to open a TRAC 
ticket, if appropriate.

I'm getting some seemingly incorrect series expansions. In particular, 
adding a constant is sometimes introducing an $x^{-1}$ term instead of an 
$x^0$ term. I have included below a fairly minimal repro. Sage correctly 
expands `(1-sqrt(1-x))/x`. However, sage insists that adding `123` 
introduces a `123*x^-1` term. Using `taylor()`, I get the expected 
expansion in both cases. 

This seems obviously incorrect, but I am new to sage so apologize if this 
is just pilot error. I looked for existing threads on power series bugs. 
The closest I found was this message 
<https://groups.google.com/g/sage-devel/c/_rB24fZSHKs/m/XneaemQ4AgAJ> asserting 
that the combinatorial species code has long been riddled with bugs. If 
this is a bug, is taylor() believed to be less bug-riddled?


*Repro:*
{{{
    sage: ((1-sqrt(1-x))/x + 0).series(x,3)                                
                  
    1/2 + 1/8*x + 1/16*x^2 + Order(x^3)  # correct
    sage: ((1-sqrt(1-x))/x + 123).series(x,3)                              
                  
    123*x^(-1) + 1/2 + 1/8*x + 1/16*x^2 + Order(x^3)  # ???
# taylor() correctly expands both
    sage: taylor((1-sqrt(1-x))/x + 0,x,0,2)                                
                  
    1/16*x^2 + 1/8*x + 1/2 
    sage: taylor((1-sqrt(1-x))/x + 123,x,0,2)                              
                  
    1/16*x^2 + 1/8*x + 247/2 
}}}

*Version:*
    │ SageMath version 9.2, Release Date: 2020-10-24                     │
    │ Using Python 3.8.5. Type "help()" for help.                        │
 *OS*: macOS Catalina (10.15.7) (64-bit x86)

Best,
Thomas


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/f858f5a5-88d1-42b3-bb64-d33e078cab4bn%40googlegroups.com.

Reply via email to