# HG changeset patch
# User Francois Bissey <francois.bissey@canterbury.ac.nz>
# Date 1303875601 -43200
# Node ID 8be9360958bf6e982b9ce4578023af3430aa018a
# Parent  c3fd103cb942608643f5b9a69b65bf08ea1cfd20
#9958 fixing numerical noise part 1

diff --git a/sage/ext/fast_callable.pyx b/sage/ext/fast_callable.pyx
--- a/sage/ext/fast_callable.pyx
+++ b/sage/ext/fast_callable.pyx
@@ -382,7 +382,7 @@
         sin(add(ipow(v_0, 2), v_1))
         sage: fc = fast_callable(expr, domain=float)
         sage: fc(5, 7)
-        0.55142668124169059
+        0.5514266812416906
     """
     cdef Expression et
     if isinstance(x, Expression):
diff --git a/sage/finance/fractal.pyx b/sage/finance/fractal.pyx
--- a/sage/finance/fractal.pyx
+++ b/sage/finance/fractal.pyx
@@ -65,7 +65,7 @@
         sage: N = 2^15
         sage: s = [1/math.sqrt(k+1) for k in [0..N]]
         sage: s[:5]
-        [1.0, 0.70710678118654746, 0.57735026918962584, 0.5, 0.44721359549995793]
+        [1.0, 0.7071067811865475, 0.5773502691896258, 0.5, 0.4472135954999579]
 
     We run the simulation::
 
diff --git a/sage/finance/markov_multifractal.py b/sage/finance/markov_multifractal.py
--- a/sage/finance/markov_multifractal.py
+++ b/sage/finance/markov_multifractal.py
@@ -97,7 +97,7 @@
 
             sage: msm = finance.MarkovSwitchingMultifractal(8,1.4,1,0.95,3)
             sage: msm.m0()
-            1.3999999999999999
+            1.4
         """
         return self.__m0
     
@@ -133,7 +133,7 @@
 
             sage: msm = finance.MarkovSwitchingMultifractal(8,1.4,0.01,0.95,3)
             sage: msm.gamma_kbar()
-            0.94999999999999996
+            0.95
         """
         return self.__gamma_kbar
     
@@ -161,7 +161,7 @@
 
             sage: msm = finance.MarkovSwitchingMultifractal(8,1.4,1.0,0.95,3)
             sage: msm.gamma()
-            (0.001368852970712986, 0.0041009402016725094, 0.012252436441829..., 0.03630878209190..., 0.10501923017634..., 0.28312883556311..., 0.6315968501359..., 0.95000000000000...)
+            (0.001368852970712986, 0.004100940201672509, 0.012252436441829..., 0.03630878209190..., 0.10501923017634..., 0.28312883556311..., 0.6315968501359..., 0.95000000000000...)
         """
         try:
             return self.__gamma
diff --git a/sage/finance/time_series.pyx b/sage/finance/time_series.pyx
--- a/sage/finance/time_series.pyx
+++ b/sage/finance/time_series.pyx
@@ -27,7 +27,7 @@
     sage: t.standard_deviation()
     0.33729638212891383
     sage: t.mean()
-    -0.089334255069294391
+    -0.08933425506929439
     sage: t.variance()
     0.1137688493972542...
 
@@ -1269,7 +1269,7 @@
             sage: v = finance.TimeSeries([1,1,1,2,3]); v
             [1.0000, 1.0000, 1.0000, 2.0000, 3.0000]
             sage: v.mean()
-            1.6000000000000001
+            1.6
         """
         return self.sum() / self._length
 
@@ -1317,9 +1317,9 @@
             sage: v = finance.TimeSeries([1,1,1,2,3]); v
             [1.0000, 1.0000, 1.0000, 2.0000, 3.0000]
             sage: v.moment(1)
-            1.6000000000000001
+            1.6
             sage: v.moment(2)
-            3.2000000000000002
+            3.2
         """
         if k <= 0:
             raise ValueError, "k must be positive"
@@ -1349,7 +1349,7 @@
 
             sage: v = finance.TimeSeries([1,2,3])
             sage: v.central_moment(2)
-            0.66666666666666663
+            0.6666666666666666
 
         Note that the central moment is different from the moment
         here, since the mean is not `0`::
@@ -1362,7 +1362,7 @@
             sage: mu = v.mean(); mu
             2.0
             sage: ((1-mu)^2 + (2-mu)^2 + (3-mu)^2) / 3
-            0.66666666666666663
+            0.6666666666666666
         """
         if k == 1:
             return float(0)
@@ -1431,11 +1431,11 @@
             sage: mu = v.mean(); sum([(a-mu)^2 for a in v])/len(v)
             14.4
             sage: v.autocovariance(1)
-            -2.70000000...
+            -2.7
             sage: mu = v.mean(); sum([(v[i]-mu)*(v[i+1]-mu) for i in range(len(v)-1)])/len(v)
-            -2.70000000...
+            -2.7
             sage: v.autocovariance(1)
-            -2.70000000...
+            -2.7
 
         We illustrate with a random sample that an independently and
         identically distributed distribution with zero mean and
@@ -1548,9 +1548,9 @@
             sage: v = finance.TimeSeries([1,1,1,2,3]); v
             [1.0000, 1.0000, 1.0000, 2.0000, 3.0000]
             sage: v.variance()
-            0.80000000000000004
+            0.8
             sage: v.variance(bias=True)
-            0.64000000000000001
+            0.64
 
         TESTS::
 
@@ -1594,7 +1594,7 @@
             sage: v.standard_deviation()
             0.8944271909...
             sage: v.standard_deviation(bias=True)
-            0.8000000000...
+            0.8
 
         TESTS::
 
@@ -2182,13 +2182,13 @@
 
             sage: s = a.standard_deviation()
             sage: len(a.clip_remove(-s,s))/float(len(a))
-            0.68309399999999998
+            0.683094
             sage: len(a.clip_remove(-2*s,2*s))/float(len(a))
-            0.95455900000000005
+            0.954559
             sage: len(a.clip_remove(-3*s,3*s))/float(len(a))
             0.997228
             sage: len(a.clip_remove(-5*s,5*s))/float(len(a))
-            0.99999800000000005
+            0.999998
 
         There were no "six sigma events"::
 
diff --git a/sage/functions/hyperbolic.py b/sage/functions/hyperbolic.py
--- a/sage/functions/hyperbolic.py
+++ b/sage/functions/hyperbolic.py
@@ -150,7 +150,7 @@
             sage: tanh(3.1415)
             0.996271386633702
             sage: float(tanh(pi))
-            0.996272076220749...
+            0.99627207622075
             sage: tan(3.1415/4)
             0.999953674278156
             sage: tanh(pi/4)
@@ -541,7 +541,7 @@
             sage: arccoth(2).n(200)
             0.54930614433405484569762261846126285232374527891137472586735
             sage: float(arccoth(2))
-            0.54930614433405489
+            0.5493061443340549
 
             sage: latex(arccoth(x))
             {\rm arccoth}\left(x\right)
@@ -639,7 +639,7 @@
             sage: arccsch(1).n(200)
             0.88137358701954302523260932497979230902816032826163541075330
             sage: float(arccsch(1))
-            0.88137358701954305
+            0.881373587019543
 
             sage: latex(arccsch(x))
             {\rm arccsch}\left(x\right)
diff --git a/sage/functions/log.py b/sage/functions/log.py
--- a/sage/functions/log.py
+++ b/sage/functions/log.py
@@ -155,9 +155,9 @@
             sage: ln(2.0)
             0.693147180559945
             sage: ln(float(-1))
-            3.1415926535897931j
+            3.141592653589793j
             sage: ln(complex(-1))
-            3.1415926535897931j
+            3.141592653589793j
 
         We do not currently support a ``hold`` parameter in functional
         notation::
@@ -207,9 +207,9 @@
             sage: log(float(0))
             -inf
             sage: log(float(-1))
-            3.1415926535897931j
+            3.141592653589793j
             sage: log(x).subs(x=float(-1))
-            3.1415926535897931j
+            3.141592653589793j
         """
         GinacFunction.__init__(self, 'log', latex_name=r'\log',
                                    conversions=dict(maxima='log'))
@@ -337,7 +337,7 @@
             sage: complex(polylog(4,2))
             (2.4278628067547032-0.17437130002545306j)
             sage: float(polylog(4,0.5))
-            0.51747906167389934
+            0.5174790616738993
 
             sage: z = var('z')
             sage: polylog(2,z).series(z==0, 5)
diff --git a/sage/functions/min_max.py b/sage/functions/min_max.py
--- a/sage/functions/min_max.py
+++ b/sage/functions/min_max.py
@@ -214,7 +214,7 @@
             sage: f = max_symbolic(sin(x), cos(x))
             sage: r = integral(f, x, 0, 1)
             sage: r.n()
-            0.87391244115672628
+            0.8739124411567263
         """
         return max_symbolic(args)
 
diff --git a/sage/functions/special.py b/sage/functions/special.py
--- a/sage/functions/special.py
+++ b/sage/functions/special.py
@@ -1441,9 +1441,9 @@
         sage: float(jacobi("sn",1/2,1/2))
         0.4707504736556572
         sage: float(inverse_jacobi("sn",0.47,1/2))
-        0.49909823132221959
+        0.4990982313222196
         sage: float(inverse_jacobi("sn",0.4707504,0.5))
-        0.49999991146655481
+        0.4999999114665548
         sage: P = plot(inverse_jacobi('sn', x, 0.5), 0, 1, plot_points=20)
     
     Now to view this, just type show(P).
diff --git a/sage/functions/spike_function.py b/sage/functions/spike_function.py
--- a/sage/functions/spike_function.py
+++ b/sage/functions/spike_function.py
@@ -38,9 +38,9 @@
         sage: from sage.functions.spike_function import SpikeFunction
         sage: S = SpikeFunction([(0,1),(1,2),(pi,-5)])
         sage: S
-        A spike function with spikes at [0.0, 1.0, 3.1415926535897931]
+        A spike function with spikes at [0.0, 1.0, 3.141592653589793]
         sage: S.support
-        [0.0, 1.0, 3.1415926535897931]
+        [0.0, 1.0, 3.141592653589793]
     """
     def __init__(self, v, eps=0.0000001):
         """
@@ -141,7 +141,7 @@
             A spike function with spikes at [-3.0, -1.0, 2.0]
             sage: P = S.plot_fft_abs(8)
             sage: p = P[0]; p.ydata
-            [5.0, 5.0, 3.3679586919241769, 3.3679586919241769, 4.1231056256176606, 4.1231056256176606, 4.7599216642180551, 4.7599216642180551]
+            [5.0, 5.0, 3.367958691924177, 3.367958691924177, 4.123105625617661, 4.123105625617661, 4.759921664218055, 4.759921664218055]
         """
         w = self.vector(samples = samples, xmin=xmin, xmax=xmax)
         xmin, xmax = self._ranges(xmin, xmax)
diff --git a/sage/functions/trig.py b/sage/functions/trig.py
--- a/sage/functions/trig.py
+++ b/sage/functions/trig.py
@@ -790,7 +790,7 @@
             sage: maxima.atan2(1,-1)
             3*%pi/4
             sage: math.atan2(1,-1)
-            2.3561944901923448
+            2.356194490192345
 
         More examples::
 
diff --git a/sage/geometry/polyhedra.py b/sage/geometry/polyhedra.py
--- a/sage/geometry/polyhedra.py
+++ b/sage/geometry/polyhedra.py
@@ -5612,7 +5612,7 @@
             sage: proj = p.projection()
             sage: filled_poly = proj.render_fill_2d()
             sage: filled_poly.axes_width()
-            0.8000...
+            0.8
         """
         poly = [polygon2d(self.coordinates_of(p), **kwds) 
                  for p in self.polygons]
diff --git a/sage/geometry/toric_plotter.py b/sage/geometry/toric_plotter.py
--- a/sage/geometry/toric_plotter.py
+++ b/sage/geometry/toric_plotter.py
@@ -773,8 +773,7 @@
     
         sage: from sage.geometry.toric_plotter import color_list
         sage: color_list("grey", 1)
-        [RGB color (0.50196078431372548,
-         0.50196078431372548, 0.50196078431372548)]
+        [RGB color (0.5019607843137255, 0.5019607843137255, 0.5019607843137255)]
         sage: len(color_list("grey", 3))
         3
         sage: color_list("rainbow", 3)
diff --git a/sage/gsl/integration.pyx b/sage/gsl/integration.pyx
--- a/sage/gsl/integration.pyx
+++ b/sage/gsl/integration.pyx
@@ -73,15 +73,15 @@
    EXAMPLES:
       To integrate the function $x^2$ from 0 to 1, we do
           sage: numerical_integral(x^2, 0, 1, max_points=100)
-          (0.33333333333333331, 3.7007434154171879e-15)
+          (0.3333333333333333, 3.700743415417188e-15)
 
       To integrate the function $\sin(x)^3 + \sin(x)$ we do
          sage: numerical_integral(sin(x)^3 + sin(x),  0, pi)
-         (3.333333333333333, 3.7007434154171883e-14)
+         (3.333333333333333, 3.700743415417188e-14)
          
       The input can be any callable:
          sage: numerical_integral(lambda x: sin(x)^3 + sin(x),  0, pi)
-         (3.333333333333333, 3.7007434154171883e-14)
+         (3.333333333333333, 3.700743415417188e-14)
 
       We check this with a symbolic integration:
          sage: (sin(x)^3+sin(x)).integral(x,0,pi)
@@ -122,7 +122,7 @@
    If we want to change the error tolerances and gauss rule used
        sage: f = x^2
        sage: numerical_integral(f, 0, 1, max_points=200, eps_abs=1e-7, eps_rel=1e-7, rule=4)
-       (0.33333333333333331, 3.7007434154171879e-15)
+       (0.3333333333333333, 3.700743415417188e-15)
 
    For a Python function with parameters:
       sage: f(x,a) = 1/(a+x^2)
@@ -159,7 +159,7 @@
    We can also numerically integrate symbolic expressions using either this
    function (which uses GSL) or the native integration (which uses Maxima):
        sage: exp(-1/x).nintegral(x, 1, 2)   # via maxima
-       (0.50479221787318396, 5.6043194293440752e-15, 21, 0)
+       (0.504792217873184, 5.604319429344075e-15, 21, 0)
        sage: numerical_integral(exp(-1/x), 1, 2)
        (0.50479221787318..., 5.60431942934407...e-15)
        
diff --git a/sage/gsl/probability_distribution.pyx b/sage/gsl/probability_distribution.pyx
--- a/sage/gsl/probability_distribution.pyx
+++ b/sage/gsl/probability_distribution.pyx
@@ -887,7 +887,7 @@
         sage: for _ in range(10000):
         ...       counts[X.get_random_element()] += 1
         sage: float(counts[1]/counts[0])
-        3.0420371867421179
+        3.042037186742118
     """
 
 
diff --git a/sage/interfaces/maxima.py b/sage/interfaces/maxima.py
--- a/sage/interfaces/maxima.py
+++ b/sage/interfaces/maxima.py
@@ -128,7 +128,7 @@
 
     sage: a = maxima('(1 + sqrt(2))^5')
     sage: float(a)
-    82.012193308819747
+    82.01219330881975
     sage: a.numer()
     82.01219330881975
 
diff --git a/sage/interfaces/maxima_abstract.py b/sage/interfaces/maxima_abstract.py
--- a/sage/interfaces/maxima_abstract.py
+++ b/sage/interfaces/maxima_abstract.py
@@ -627,7 +627,7 @@
             sage: t(2)
              sin(2)
             sage: float(t(2))
-            0.90929742682568171
+            0.9092974268256817
             sage: loads(t.dumps())
             gamma(x)*sin(x)
         """
@@ -1592,11 +1592,11 @@
         EXAMPLES::
         
             sage: float(maxima("3.14"))
-            3.1400000000000001
+            3.14
             sage: float(maxima("1.7e+17"))
             1.7e+17
             sage: float(maxima("1.7e-17"))
-            1.6999999999999999e-17
+            1.7e-17
         """
         try:
             return float(repr(self.numer()))
diff --git a/sage/interfaces/r.py b/sage/interfaces/r.py
--- a/sage/interfaces/r.py
+++ b/sage/interfaces/r.py
@@ -167,7 +167,7 @@
 
     sage: rr = r.dnorm(r.seq(-3,3,0.1))
     sage: sum(rr._sage_())
-    9.9772125168981081
+    9.977212516898108
 
 Or you get a dictionary to be able to access all the information.
 
diff --git a/sage/lfunctions/dokchitser.py b/sage/lfunctions/dokchitser.py
--- a/sage/lfunctions/dokchitser.py
+++ b/sage/lfunctions/dokchitser.py
@@ -315,7 +315,7 @@
             0.998583063162746
             sage: a = delta_qexp(1000)
             sage: sum(a[n]/float(n)^14 for n in range(1,1000))
-            0.99858306316274592
+            0.9985830631627459
 
         Illustrate that one can give a list of complex numbers for v (see trac 10937)::
 
diff --git a/sage/misc/explain_pickle.py b/sage/misc/explain_pickle.py
--- a/sage/misc/explain_pickle.py
+++ b/sage/misc/explain_pickle.py
@@ -848,12 +848,12 @@
             sage: from sage.misc.explain_pickle import *
             sage: test_pickle(float(pi))
                 0: \x80 PROTO      2
-                2: G    BINFLOAT   3.1415926535897931
+                2: G    BINFLOAT   3.141592653589793
                11: .    STOP
             highest protocol among opcodes = 2
             explain_pickle in_current_sage=True/False:
             float(RR(3.1415926535897931))
-            result: 3.1415926535897931
+            result: 3.141592653589793
         """
         self.push(self.sib(f))
 
diff --git a/sage/misc/prandom.py b/sage/misc/prandom.py
--- a/sage/misc/prandom.py
+++ b/sage/misc/prandom.py
@@ -167,7 +167,7 @@
 
     EXAMPLES:
         sage: [random() for i in [1 .. 4]]
-        [0.111439293741037, 0.51434751341916773, 0.044689685248156419, 0.33249060644241302]
+        [0.111439293741037, 0.5143475134191677, 0.04468968524815642, 0.332490606442413]
     """
     return _pyrand().random()
 
@@ -180,7 +180,7 @@
         sage: uniform(0, 1)
         0.111439293741037
         sage: uniform(e, pi)
-        0.51434751341916773*pi + 0.48565248658083227*e
+        0.5143475134191677*pi + 0.48565248658083227*e
         sage: RR(_)
         2.93601069876846
     """
@@ -213,7 +213,7 @@
         sage: [expovariate(1.0) for i in range(3)]
         [1.10114367058632, 0.652772818610748, 1.69983589896220]
         sage: [expovariate(1000) for i in range(3)]
-        [0.00035543583938093908, 0.0025254102812587195, 0.0001175899408167489]
+        [0.0003554358393809391, 0.0025254102812587195, 0.0001175899408167489]
     """
     return _pyrand().expovariate(lambd)
 
@@ -239,11 +239,11 @@
 
     EXAMPLES:
        sage: [gauss(0, 1) for i in range(3)]
-       [0.91910117576579153, 0.77445267562464837, 0.86389968668008765]
+       [0.9191011757657915, 0.7744526756246484, 0.8638996866800877]
        sage: [gauss(0, 100) for i in range(3)]
-       [24.916051749154448, -62.992720615792727, -8.1993122536718...]
+       [24.916051749154448, -62.99272061579273, -8.1993122536718...]
        sage: [gauss(1000, 10) for i in range(3)]
-       [998.75907000456607, 996.10873385116918, 1010.1256817458031]
+       [998.7590700045661, 996.1087338511692, 1010.1256817458031]
     """
     return _pyrand().gauss(mu, sigma)
 
@@ -256,7 +256,7 @@
 
     EXAMPLES:
         sage: [lognormvariate(100, 10) for i in range(3)]
-        [2.9410355688290246e+37, 2.2257548162070125e+38, 4.1422994517174461e+43]
+        [2.9410355688290246e+37, 2.2257548162070125e+38, 4.142299451717446e+43]
     """
     return _pyrand().lognormvariate(mu, sigma)
 
@@ -267,11 +267,11 @@
 
     EXAMPLES:
        sage: [normalvariate(0, 1) for i in range(3)]
-       [-1.3725589805594069, -1.1701670364898928, 0.043241005551101427]
+       [-1.372558980559407, -1.1701670364898928, 0.04324100555110143]
        sage: [normalvariate(0, 100) for i in range(3)]
-       [37.456958750417691, 159.63477432332979, 124.10293211240089]
+       [37.45695875041769, 159.6347743233298, 124.1029321124009]
        sage: [normalvariate(1000, 10) for i in range(3)]
-       [1008.5303090383741, 989.86248926448945, 985.77289211502421]
+       [1008.5303090383741, 989.8624892644895, 985.7728921150242]
     """
     return _pyrand().normalvariate(mu, sigma)
 
@@ -285,7 +285,7 @@
 
     EXAMPLES:
         sage: [vonmisesvariate(1.0r, 3.0r) for i in range(1, 5)]
-        [0.89832863935542584, 0.67180300070412846, 2.0308777524813397, 1.714325253725145...]
+        [0.8983286393554258, 0.6718030007041285, 2.0308777524813397, 1.714325253725145...]
     """
     return _pyrand().vonmisesvariate(mu, kappa)
 
@@ -305,7 +305,7 @@
 
     EXAMPLES:
         sage: [weibullvariate(1, 3) for i in range(1, 5)]
-        [0.49069775546342537, 0.89721855646112125, 0.35757384653194202, 0.73937725551684697]
+        [0.49069775546342537, 0.8972185564611213, 0.357573846531942, 0.739377255516847]
     """
     return _pyrand().weibullvariate(alpha, beta)
 
diff --git a/sage/misc/preparser.py b/sage/misc/preparser.py
--- a/sage/misc/preparser.py
+++ b/sage/misc/preparser.py
@@ -173,7 +173,7 @@
 
     sage: z = 3.1415R
     sage: z
-    3.1415000000000002
+    3.1415
     sage: type(z)
     <type 'float'>
 
diff --git a/sage/misc/randstate.pyx b/sage/misc/randstate.pyx
--- a/sage/misc/randstate.pyx
+++ b/sage/misc/randstate.pyx
@@ -55,24 +55,24 @@
 
     sage: set_random_seed(0)
     sage: rtest()
-    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 963229057, 8045, 0.96619117347084138)  # 32-bit
-    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 265625921, 8045, 0.96619117347084138)  # 64-bit
+    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 963229057, 8045, 0.9661911734708414)  # 32-bit
+    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 265625921, 8045, 0.9661911734708414)  # 64-bit
     sage: set_random_seed(1)
     sage: rtest()
     (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.83350776541997362)  # 32-bit
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ],  807447831, 60359, 0.83350776541997362)  # 64-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 807447831, 60359, 0.8335077654199736)  # 64-bit
     sage: set_random_seed(2)
     sage: rtest()
     (207, 0.505364206568040, 4*x^2 + 1/2, (1,2)(4,5), [ 0, 0, 1, 0, 1 ],  637693405, 27695, 0.19982565117278328)  # 32-bit
     (207, 0.505364206568040, 4*x^2 + 1/2, (1,2)(4,5), [ 0, 0, 1, 0, 1 ], 1642898426, 27695, 0.19982565117278328)  # 64-bit
     sage: set_random_seed(0)
     sage: rtest()
-    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 963229057, 8045, 0.96619117347084138)  # 32-bit
-    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 265625921, 8045, 0.96619117347084138)  # 64-bit
+    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 963229057, 8045, 0.9661911734708414)  # 32-bit
+    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 265625921, 8045, 0.9661911734708414)  # 64-bit
     sage: set_random_seed(1)
     sage: rtest()
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.83350776541997362)  # 32-bit
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ],  807447831, 60359, 0.83350776541997362)  # 64-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.8335077654199736)  # 32-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 807447831, 60359, 0.8335077654199736)  # 64-bit
     sage: set_random_seed(2)
     sage: rtest()
     (207, 0.505364206568040, 4*x^2 + 1/2, (1,2)(4,5), [ 0, 0, 1, 0, 1 ],  637693405, 27695, 0.19982565117278328)  # 32-bit
@@ -86,8 +86,8 @@
     sage: initial_seed()
     12345L
     sage: rtest()
-    (720, 0.0216737401150802, x^2 - x, (), [ 1, 0, 0, 0, 0 ], 912534076, 14005, 0.92053315995181839)   # 32-bit
-    (720, 0.0216737401150802, x^2 - x, (), [ 1, 0, 0, 0, 0 ], 1911581957, 14005, 0.92053315995181839)  # 64-bit
+    (720, 0.0216737401150802, x^2 - x, (), [ 1, 0, 0, 0, 0 ], 912534076, 14005, 0.9205331599518184)   # 32-bit
+    (720, 0.0216737401150802, x^2 - x, (), [ 1, 0, 0, 0, 0 ], 1911581957, 14005, 0.9205331599518184)  # 64-bit
     sage: initial_seed()
     12345L
 
@@ -151,7 +151,7 @@
     (0.111439293741037, 539332L, 8.26785106378383, 1.3893337539828183)
     sage: set_random_seed(1)
     sage: random(), getrandbits(20), uniform(5.0, 10.0), normalvariate(0, 1)
-    (0.82940228518742587, 624859L, 5.77894484361117, -0.42013668263087578)
+    (0.8294022851874259, 624859L, 5.77894484361117, -0.4201366826308758)
     sage: set_random_seed(0)
     sage: random(), getrandbits(20), uniform(5.0, 10.0), normalvariate(0, 1)
     (0.111439293741037, 539332L, 8.26785106378383, 1.3893337539828183)
@@ -222,8 +222,8 @@
 
     sage: set_random_seed(0)
     sage: r1 = rtest(); r1
-    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 963229057, 8045, 0.96619117347084138)  # 32-bit
-    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 265625921, 8045, 0.96619117347084138)  # 64-bit
+    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 963229057, 8045, 0.9661911734708414)  # 32-bit
+    (303, -0.187141682737491, 1/2*x^2 - 1/95*x - 1/2, (1,2,3)(4,5), [ 0, 0, 0, 0, 1 ], 265625921, 8045, 0.9661911734708414)  # 64-bit
     sage: r2 = rtest(); r2
     (105, -0.581229341007821, -x^2 - x - 6, (1,3), [ 1, 0, 0, 1, 1 ], 14082860, 1271, 0.001767155077382232)  # 32-bit
     (105, -0.581229341007821, -x^2 - x - 6, (1,3), [ 1, 0, 0, 1, 1 ], 53231108, 1271, 0.001767155077382232)  # 64-bit
@@ -234,8 +234,8 @@
     sage: r1 == rtest()
     True
     sage: with seed(1): rtest()
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.83350776541997362)  # 32-bit
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ],  807447831, 60359, 0.83350776541997362)  # 64-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.8335077654199736)  # 32-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ],  807447831, 60359, 0.8335077654199736)  # 64-bit
     sage: r2m = rtest(); r2m
     (105, -0.581229341007821, -x^2 - x - 6, (1,3), [ 1, 0, 0, 1, 1 ], 14082860, 19769, 0.001767155077382232)  # 32-bit
     (105, -0.581229341007821, -x^2 - x - 6, (1,3), [ 1, 0, 0, 1, 1 ], 53231108, 19769, 0.001767155077382232)  # 64-bit
@@ -277,8 +277,8 @@
     ... finally:
     ...       ctx.__exit__(None, None, None)
     <sage.misc.randstate.randstate object at 0x...>
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.83350776541997362)  # 32-bit
-    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ],  807447831, 60359, 0.83350776541997362)  # 64-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ], 1161603091, 60359, 0.8335077654199736)  # 32-bit
+    (978, 0.184109262667515, -3*x^2 - 1/12, (4,5), [ 0, 1, 1, 0, 0 ],  807447831, 60359, 0.8335077654199736)  # 64-bit
     False
     sage: r2m == rtest()
     True
diff --git a/sage/modular/modform/eis_series.py b/sage/modular/modform/eis_series.py
--- a/sage/modular/modform/eis_series.py
+++ b/sage/modular/modform/eis_series.py
@@ -343,7 +343,7 @@
        -0.291657724743873
        sage: L = eisenstein_series_lseries(20)
        sage: L(2)
-       -5.02355351645987 
+       -5.02355351645989 
     """
     f = eisenstein_series_qexp(weight,prec)
     from sage.lfunctions.all import Dokchitser
diff --git a/sage/modules/free_module_element.pyx b/sage/modules/free_module_element.pyx
--- a/sage/modules/free_module_element.pyx
+++ b/sage/modules/free_module_element.pyx
@@ -3123,11 +3123,11 @@
             sage: type(vec)
             <type 'sage.modules.vector_real_double_dense.Vector_real_double_dense'>
             sage: answers
-            [(0.5, 5.5511151231257843e-15, 21, 0), (0.3333333333333..., 3.7007434154171903e-15, 21, 0), (0.45969769413186..., 5.1036696439228408e-15, 21, 0)]
+            [(0.5, 5.551115123125784e-15, 21, 0), (0.3333333333333..., 3.70074341541719e-15, 21, 0), (0.45969769413186..., 5.103669643922841e-15, 21, 0)]
 
             sage: r=vector([t,0,1], sparse=True)
             sage: r.nintegral(t,0,1)            
-            ((0.5, 0.0, 1.0), {0: (0.5, 5.5511151231257843e-15, 21, 0), 2: (1.0, 1.11022302462515...e-14, 21, 0)})
+            ((0.5, 0.0, 1.0), {0: (0.5, 5.551115123125784e-15, 21, 0), 2: (1.0, 1.11022302462515...e-14, 21, 0)})
 
         """
         # If Cython supported lambda functions, we would just do
diff --git a/sage/stats/basic_stats.py b/sage/stats/basic_stats.py
--- a/sage/stats/basic_stats.py
+++ b/sage/stats/basic_stats.py
@@ -239,7 +239,7 @@
         2.5
         sage: x = finance.TimeSeries([1..100])
         sage: variance(x)
-        841.66666666666663
+        841.6666666666666
         sage: variance(x, bias=True)
         833.25
         sage: class MyClass:
diff --git a/sage/stats/hmm/chmm.pyx b/sage/stats/hmm/chmm.pyx
--- a/sage/stats/hmm/chmm.pyx
+++ b/sage/stats/hmm/chmm.pyx
@@ -124,7 +124,7 @@
     of states produced obs::
 
         sage: m.viterbi(obs)
-        ([1, 0, 1, 0, 1, 1, 0, 1, 0, 1], -16.677382701707881)
+        ([1, 0, 1, 0, 1, 1, 0, 1, 0, 1], -16.67738270170788)
 
     We use the Baum-Welch iterative algorithm to find another model
     for which our observation sequence is more likely::
@@ -258,9 +258,9 @@
             sage: m[0]
             (1.0, 0.5)
             sage: m[1]
-            (-2.0, 0.29999999999999999)
+            (-2.0, 0.3)
             sage: m[-1]
-            (-2.0, 0.29999999999999999)
+            (-2.0, 0.3)
             sage: m[3]
             Traceback (most recent call last):
             ...
@@ -476,7 +476,7 @@
 
             sage: m = hmm.GaussianHiddenMarkovModel([[.1,.9],[.5,.5]], [(1,.5), (-1,3)], [.1,.9])
             sage: m.log_likelihood([1,1,1])
-            -4.2978807660724856
+            -4.297880766072486
             sage: set_random_seed(0); s = m.sample(20)
             sage: m.log_likelihood(s)
             -40.115714129484...
@@ -577,7 +577,7 @@
             sage: m.viterbi([-2,-1,.1,0.1])
             ([1, 1, 0, 1], -9.61823698847639...)
             sage: m.viterbi([-2,-1,.1,0.3])
-            ([1, 1, 1, 0], -9.5660236533785135)
+            ([1, 1, 1, 0], -9.566023653378513)
         """
         cdef TimeSeries _obs
         if not isinstance(obs, TimeSeries):
@@ -812,7 +812,7 @@
 
             sage: m = hmm.GaussianHiddenMarkovModel([[.1,.9],[.5,.5]], [(1,.5), (-1,3)], [.1,.9])
             sage: m.log_likelihood([-2,-1,.1,0.1])
-            -8.8582822159862751
+            -8.858282215986275
             sage: m.baum_welch([-2,-1,.1,0.1])
             (22.164539478647512, 8)
             sage: m.log_likelihood([-2,-1,.1,0.1])
diff --git a/sage/stats/hmm/distributions.pyx b/sage/stats/hmm/distributions.pyx
--- a/sage/stats/hmm/distributions.pyx
+++ b/sage/stats/hmm/distributions.pyx
@@ -146,7 +146,7 @@
         sage: P = hmm.GaussianMixtureDistribution([(.3,1,2),(.7,-1,1)]); P
         0.3*N(1.0,2.0) + 0.7*N(-1.0,1.0)
         sage: P[0]
-        (0.29999999999999999, 1.0, 2.0)
+        (0.3, 1.0, 2.0)
         sage: P.is_fixed()
         False
         sage: P.fix(1)
@@ -213,13 +213,13 @@
 
             sage: P = hmm.GaussianMixtureDistribution([(.2,-10,.5),(.6,1,1),(.2,20,.5)])
             sage: P[0]
-            (0.20000000000000001, -10.0, 0.5)
+            (0.2, -10.0, 0.5)
             sage: P[2]
-            (0.20000000000000001, 20.0, 0.5)
+            (0.2, 20.0, 0.5)
             sage: [-1]
             [-1]
             sage: P[-1]
-            (0.20000000000000001, 20.0, 0.5)
+            (0.2, 20.0, 0.5)
             sage: P[3]
             Traceback (most recent call last):
             ...
@@ -393,7 +393,7 @@
 
             sage: P = hmm.GaussianMixtureDistribution([(.2,-10,.5),(.6,1,1),(.2,20,.5)])
             sage: P.sample()
-            19.658243610875129
+            19.65824361087513
             sage: P.sample(1)
             [-10.4683]
             sage: P.sample(5)
@@ -497,7 +497,7 @@
 
             sage: P = hmm.GaussianMixtureDistribution([(.2,-10,.5),(.6,1,1),(.2,20,.5)])
             sage: P.prob_m(.5, 0)
-            2.760811768050888...e-97
+            2.7608117680508...e-97
             sage: P.prob_m(.5, 1)
             0.21123919605857971
             sage: P.prob_m(.5, 2)
diff --git a/sage/stats/hmm/hmm.pyx b/sage/stats/hmm/hmm.pyx
--- a/sage/stats/hmm/hmm.pyx
+++ b/sage/stats/hmm/hmm.pyx
@@ -266,7 +266,7 @@
         sage: m.log_likelihood([0,1,0,1,0,1])
         -4.66693474691329...
         sage: m.viterbi([0,1,0,1,0,1])
-        ([1, 1, 1, 1, 1, 1], -5.3788328422087481)
+        ([1, 1, 1, 1, 1, 1], -5.378832842208748)
         sage: m.baum_welch([0,1,0,1,0,1])
         (0.0, 22)
         sage: m
@@ -479,7 +479,7 @@
             sage: m.log_likelihood([0, 1, 0, 1, 1, 0, 1, 0, 0, 0])
             -7.3301308009370825
             sage: m.log_likelihood([0, 1, 0, 1, 1, 0, 1, 0, 0, 0], scale=False)
-            -7.3301308009370816
+            -7.330130800937082
             sage: m.log_likelihood([])
             0.0
 
@@ -493,7 +493,7 @@
 
             sage: m = hmm.DiscreteHiddenMarkovModel([[0.4,0.6],[0.1,0.9]], [[0.1,0.9],[0.5,0.5]], [.2,.8])
             sage: m.log_likelihood([0,1]*1000, scale=True)
-            -1433.8206666527281
+            -1433.820666652728
             sage: m.log_likelihood([0,1]*1000, scale=False)
             -inf
         """
@@ -591,7 +591,7 @@
         non-scaled algorithm::
 
             sage: m._forward_scale(stats.IntList([0,1]*1000))
-            -1433.8206666527281
+            -1433.820666652728
             sage: m._forward(stats.IntList([0,1]*1000))
             -inf
 
@@ -599,7 +599,7 @@
 
             sage: set_random_seed(0); v = m.sample(1000)
             sage: m._forward_scale(v)
-            -686.87531893650555
+            -686.8753189365056
         """
         # This is just like self._forward(obs) above, except at every step of the
         # algorithm, we rescale the vector alpha so that the sum of
@@ -855,7 +855,7 @@
 
             sage: m = hmm.DiscreteHiddenMarkovModel([[0.1,0.9],[0.9,0.1]], [[1,0],[0,1]], [.2,.8])
             sage: m._viterbi(stats.IntList([1]*5))
-            ([1, 1, 1, 1, 1], -9.4334839232903924)
+            ([1, 1, 1, 1, 1], -9.433483923290392)
             sage: m._viterbi(stats.IntList([0]*5))
             ([0, 0, 0, 0, 0], -10.819778284410283)
 
@@ -934,7 +934,7 @@
 
             sage: m = hmm.DiscreteHiddenMarkovModel([[0.1,0.9],[0.9,0.1]], [[.5,.5],[0,1]], [.2,.8])
             sage: m._viterbi_scale(stats.IntList([1]*10))
-            ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], -4.6371240950343733)
+            ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], -4.637124095034373)
 
         Long sequences should not overflow::
 
@@ -1202,7 +1202,7 @@
             sage: m = hmm.DiscreteHiddenMarkovModel([[0.1,0.9],[0.9,0.1]], [[.5,.5],[.2,.8]], [.2,.8])
             sage: set_random_seed(0); v = m.sample(100)
             sage: m.baum_welch(v,fix_emissions=True)
-            (-66.986308569187742, 100)
+            (-66.98630856918774, 100)
             sage: m.emission_matrix()
             [0.5 0.5]
             [0.2 0.8]
