Comment #12 on issue 3068 by smi...@gmail.com: incorrect sign calculated
http://code.google.com/p/sympy/issues/detail?id=3068

Although changes have been committed that allow SymPy to return the sign if it thinks that it can be computed, there is still an error somewhere. The following XFAIL test was added because the computed sign should always by 1 regardless of x, but it is not (it ends up being -1).

```
@XFAIL
def test_issue_3068X():
    eps = pi**-1500
    big = pi**1000
    one = cos(x)**2 + sin(x)**2
    e = big*one - big + eps
    assert sign(simplify(e)) == 1
    for xi in (111, 11, 1, S(1)/10):
        assert sign(e.subs(x, xi)) == 1

example for q = e.subs(x, 1)

q
pi**(-1500) - pi**1000*(cos(1)**2 + sin(1)**2) + pi**1000
sign(q)
-1
q.is_positive
q.is_negative
q.is_zero

```

Somewhere SymPy gets the idea that the sign can be computed, but sign() should agree with the assumption system which says (for the above) that it can't decide, and since sign got it wrong it should be determined where this faulty determination is being made.



--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

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


Reply via email to