Status: Started
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2842 by smi...@gmail.com: evalf should not use conjugate or expand if there are symbols; 1 should return as 1.0
http://code.google.com/p/sympy/issues/detail?id=2842

evalf assumes in a few places that it is dealing with numbers so it expands or uses conjugate,

((x - 1)*((1 - x))**2).n()
x**3 - 3*x**2 + 3*x - 1
(1/((x - 1)*((1 - x))**2)).n()

conjugate(x)**3/((x*conjugate(x) - x - conjugate(x) +
1)*(x**2*conjugate(x)**2 - 2*x**2*conjugate(x) + x**2 -
2*x*conjugate(x)**2 + 4*x*conjugate(x) - 2*x +
conjugate(x)**2 - 2*conjugate(x) + 1)) -
3*conjugate(x)**2/((x*conjugate(x) - x - conjugate(x) +
1)*(x**2*conjugate(x)**2 - 2*x**2*conjugate(x) + x**2 -
2*x*conjugate(x)**2 + 4*x*conjugate(x) - 2*x +
conjugate(x)**2 - 2*conjugate(x) + 1)) +
3*conjugate(x)/((x*conjugate(x) - x - conjugate(x) +
1)*(x**2*conjugate(x)**2 - 2*x**2*conjugate(x) + x**2 -
2*x*conjugate(x)**2 + 4*x*conjugate(x) - 2*x +
conjugate(x)**2 - 2*conjugate(x) + 1)) - 1/((x*conjugate(x)
- x - conjugate(x) + 1)*(x**2*conjugate(x)**2 -
2*x**2*conjugate(x) + x**2 - 2*x*conjugate(x)**2 +
4*x*conjugate(x) - 2*x + conjugate(x)**2 - 2*conjugate(x) +
1))

With a few tweaks this becomes:

((x - 1)*((1 - x))**2).n()
(-x + 1.0)**2*(x - 1.0)
(1/((x - 1)*((1 - x))**2)).n()
1/((-x + 1.0)**2*(x - 1.0))


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to