Hello, 

I am trying to simplify the following expression:


E = '(-2*d11*d23*d32 + 4*d11 - 4*d12*d21 + 2*d12*d23*d31 + 1.0*d12*d31 + 
2*d13*d21*d32 - 2*d13*d22*d31 - 2*d13*d31 + d22*d31 + d22*(4*d11 + 4) - 
2*d23*d32 - d31*(d22 + 1) + d31 - 1.0*d32*(d11 + 1) + 2*d33*(d11*d22 + d11 
- d12*d21 + d22 + 1) + 4)/(2.0*d11*(d22*d33 + d22 - d23*d32 + d33 + 1) - 
2.0*d12*(d21*d33 + d21 - d23*d31) + 2.0*d13*d21*d32 - 2.0*d13*d31*(d22 + 1) 
+ 2.0*d22*d33 + 2.0*d22 - 2.0*d23*d32 + 2.0*d33 + 2.0)' 

When I run

 ``` 
from sympy import * 
from sympy.parsing.sympy_parser import parse_expr 
  
str(simplify(parse_expr(E))) 
```

I get this result back: 

'0.5*(-2*d11*d23*d32 + 4*d11 - 4*d12*d21 + 2*d12*d23*d31 + 1.0*d12*d31 + 
2*d13*d21*d32 - 2*d13*d22*d31 - 2*d13*d31 + d22*d31 + 4*d22*(d11 + 1) - 
2*d23*d32 - d31*(d22 + 1) + d31 - 1.0*d32*(d11 + 1) + 2*d33*(d11*d22 + d11 
- d12*d21 + d22 + 1) + 4)/(d11*(d22*d33 + d22 - d23*d32 + d33 + 1) - 
d12*(d21*d33 + d21 - d23*d31) + d13*d21*d32 - d13*d31*(d22 + 1) + d22*d33 + 
d22 - d23*d32 + d33 + 1)' 

Which didn't remove 1.0 and fully simplify the expression. Currently 
running Sympy version '1.5.1'. 

I tried expanding and simplify again as well as multiply and dividing by 1. 
But these operations didn't work and I can't fully reduce the expression. 
Is there a way to simplify the equation further in Sympy? Am I doing 
something wrong? 

 Best wishes! 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy/2f7d9db0-89a0-4984-91b2-f9093fd4d372%40googlegroups.com.

Reply via email to