add judicious numerical testing to is_constant and equals

    The _random method was added to expr to fascilitate testing.
    That routine is described by its docstring.

    The judiciousness of the new testing comes from using evalf
    to disprove (rather than prove) something is constant or that
    two expressions are equal. e.g. to disprove that something is
    constant, one need only substitute in two different values and
    see if they are different or not. If different, the expression
    cannot be constant. If the two values are the same, *or* if
    no significance could be obtained (because, perhaps, the expression
    is zero) then no conclusion is drawn.
modifications in response to review
Merge pull request #1036 from smichr/equals

detect other non-zero expressions in equals() method
3022: watch for recursive condition in Pow.as_real_imag
pep8 edits of Numbers
all Numbers support divmod

When divmod(2, S(3)) is called, Python passes the call off to
Integer.__rdivmod__ because S(3) is an Integer. The arguments
__rdivmod__ receives are rdivmod(S(3), 2) -- note the reversal of
arguments relative to the first call. Since there was no __rdivmod__ for
anything but Integer, any call to divmod with python number first
failed; since there was no __divmod__ written for anything but Integer,
a call to divmod with the first argument anything but an Integer failed.

__rdivmod__ and __divmod__ are now defined in Number so Rationals and
Floats now work, too. The Integer versions of __rdivmod__ and __divmod__
were left in place since they are about 2X faster.

The following lines were deleted from __rdivmod__ because, with the
argument reversal, other is the Integer -- fortunately this always failed
or else the next line would have since self is not a SymPy object (or
else __rdivmod__ wouldn't have been called, self's __divmod__ routine would
have been called.

-        if isinstance(other, Integer):
-            return Tuple(*divmod(other.p, self.p))
Numbers coverage related changes

    Changes were made after reviewing lines that were not covered in tests:

    - in radd, rsub, rmul the test for Integer never succeeds because
      in an expression like 2 + S(3) Add (etc.) already handle this.

    - gcdex lost efficiency of detecting other as an integer when
      changes were made changing b to other: b was replaced with self.

    - expt.is_number does not need to evaluate expt as the test for
      is_positive and is_negative already does this. In addition, only
      a single is_positive test is needed since that might be True, False
      or None -- False implies is_negative is True.

    - nan**0 should not be 1 (this is fixed fully and tested in a subsequent
      commit).
_coeff_isneg is not needed for Atoms
expt -> exp in Numbers

    As the mpf convention already present in the file uses exp;
    and attributes of powers are referred to as base/exp; and the
    variable 'expt' only appears in one other place in SymPy, the
    variables 'expt' in Numbers were made to conform with the existing
    precedent of using 'exp' for exponent.
edit _eval_power methods

    Since the exponents of NaN, 0 and 1 are handled at instantiation, no
    routine need handle these. And where routines of an object handle
    powers, their parent class need not look for those numbers in
    their processing of powers (e.g. S.One implements _eval_power so
    Integer does not need to check if a base is S.One in its own
    routine).

    Also, since 0 and 1 are handled at instantiation, b = S.NaN has
    to be tested for as well or else nan**0 will become 1.
check for both is_positive and is_negative

    If is_positive is False is True this does not mean that is_negative
    is True - a complex object has both is_positive and is_negative as
    False.
follow IEEE 754 regarding NaN**0 and 1**NaN
Ask even, integer and prime correction

    When an expr is a number (not Number) comparing the computed int()
    of it to the original expression will fail so equals() is used to
    make the comparison.
add note about Functions/AppliedUndef in core.txt

    Also added an example in the docstring of atoms().
Merge pull request #1032 from smichr/3033

3033: note about searching for f(x), not cos(x), in expr
Cleanup tests for issue 1724

Remove old XFAIL test for 1724 and move the new one to test_complex.py
Move test for 2330 as well.

NB: issues 1724 and 2330 have been solved
by 8efe52a6a4acf8307e4e0dd176ccce720604cce3
Cleanup test_subs.py

* Code formatting
* Merge xpassing test for 2261 with an existing one
Move slow test to sympy/core/tests/

test_integer_nthroot was the only content of sympy/slow_tests/
Moving it to sympy/core/tests allows the rather useless directory
to be removed. The test is marked @slow.
3097: preview() accepts keyword args which are passed to latex()
Merge pull request #1057 from mrocklin/sample_lambdify

Use lambdify in sample_iter instead of subs.