Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 46c8e43

Browse files
committed
6119: use fast series in taylor when possible
1 parent 14216c6 commit 46c8e43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sage/symbolic/expression.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4209,7 +4209,7 @@ cdef class Expression(CommutativeRingElement):
42094209
::
42104210
42114211
sage: taylor(sqrt (sin(x) + a*x + 1), x, 0, 3)
4212-
1/48*(3*a^3 + 9*a^2 + 9*a - 1)*x^3 - 1/8*(a^2 + 2*a + 1)*x^2 + 1/2*(a + 1)*x + 1
4212+
-1/8*(a + 1)^2*x^2 + 1/48*(3*(a + 1)^3 - 4)*x^3 + 1/2*(a + 1)*x + 1
42134213
42144214
::
42154215
@@ -4259,6 +4259,8 @@ cdef class Expression(CommutativeRingElement):
42594259
B.append(Integer(A[len(A)-1]))
42604260
except Exception:
42614261
raise NotImplementedError("Wrong arguments passed to taylor. See taylor? for more details.")
4262+
if not isinstance(A[0],tuple):
4263+
return self.series(A[0]==A[1], A[2]+1).truncate()
42624264
l = self._maxima_().taylor(B)
42634265
return self.parent()(l)
42644266

0 commit comments

Comments
 (0)