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

Commit 2207350

Browse files
committed
Fix bug with diff(...) in simplify_sqrt_real
1 parent 14216c6 commit 2207350

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/sage/manifolds/utilities.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ def simplify_sqrt_real(expr):
8787
sexpr = str(expr)
8888
if 'sqrt(' not in sexpr: # no sqrt to simplify
8989
return expr
90-
if 'D[' in sexpr:
90+
if ('D[' in sexpr) or ('diff(' in sexpr):
9191
return expr #!# the code below is not capable of simplifying
92-
# expressions with symbolic derivatives denoted by Pynac
93-
# symbols of the type D[0]
92+
# expressions with symbolic derivatives denoted
93+
# by Pynac symbols of the type D[0] or diff(...)
9494
# Lists to store the positions of all the top-level sqrt's in sexpr:
9595
pos_sqrts = [] # position of first character, i.e. 's' of 'sqrt(...)'
9696
pos_after = [] # position of character immediatelty after 'sqrt(...)'
@@ -203,6 +203,10 @@ def simplify_abs_trig(expr):
203203
sexpr = str(expr)
204204
if 'abs(sin(' not in sexpr: # nothing to simplify
205205
return expr
206+
if ('D[' in sexpr) or ('diff(' in sexpr):
207+
return expr #!# the code below is not capable of simplifying
208+
# expressions with symbolic derivatives denoted
209+
# by Pynac symbols of the type D[0] or diff(...)
206210
tp = []
207211
val = []
208212
for pos in range(len(sexpr)):

0 commit comments

Comments
 (0)