ellipsize line numbers
Trac #16889: Doctest tolerance: allow spaces and use intervals

The doctesting framework should ignore whitespace before numbers and
between the sign and the number when testing with `(abs|rel) tol`. There
are two reasons why:

1. The spacing of matrices is unpredictable. You could have
{{{
[1.0 0.0]
[1.0 0.0]
}}}
vs
{{{
[0.999999 0.0]
[     1.0 0.0]
}}}
Note the added space between `[` and `1.0`.

2. Complex numbers or polynomials
{{{
1.0 + 1e-16*I
}}}
vs
{{{
1.0 - 1e-16*I
}}}
Here you want to compare ` + 1e-16` and ` - 1e-16` with the sign for
your tolerance computations.

After some consideration, I decided it actually makes a lot of sense to
use interval arithmetic for doctest tolerances, this is implemented on
this ticket.

URL: http://trac.sagemath.org/16889
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Volker Braun
Trac #16858: Print RDF and CDF elements with more digits

With the optional package `cbc` installed:
{{{
sage -t --long src/sage/numerical/mip.pyx
**********************************************************************
File "src/sage/numerical/mip.pyx", line 1470, in sage.numerical.mip.Mixe
dIntegerLinearProgram.number_of_variables.add_constraint
Failed example:
    p.solve()     # rel tol 1e-15
Expected:
    6.666666666666666
Got:
    6.66666666667
Tolerance exceeded: 5e-13 > 1e-15
**********************************************************************
[...several similar failures not shown...]
}}}

The underlying reason is that the `coin` solver returns an `RDF`
element, while the `glpk` solver returns a Python float. These are
printed differently, even though they have the same value.

The branch here changes `__repr__` for `RDF` and `CDF` elements and
fixes tons of doctests. Other small fixes are switching `__str__` and
`__repr__` for some classes in `real_roots.pyx` and some doctest
reformatting.

URL: http://trac.sagemath.org/16858
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Volker Braun