# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1342098436 -7200
# Node ID b7822096e3e2d5b7011ae77470d297febc3c01a8
# Parent 96b55269c018aa8ebeed0672671a31e5ab7e9267
Increase the tolerance for a test depending on ATLAS
diff --git a/sage/rings/polynomial/polynomial_element.pyx b/sage/rings/polynomial/polynomial_element.pyx
a
|
b
|
|
1037 | 1037 | polynomial 1 and have extra terms with coefficients close to zero. :: |
1038 | 1038 | |
1039 | 1039 | sage: R.<x> = RDF[] |
| 1040 | sage: epsilon = RDF(1).ulp()*50 # Allow an error of up to 50 ulp |
1040 | 1041 | sage: f = inverse_mod(x^2 + 1, x^5 + x + 1); f |
1041 | 1042 | 0.4*x^4 - 0.2*x^3 - 0.4*x^2 + 0.2*x + 0.8 |
1042 | 1043 | sage: poly = f * (x^2 + 1) % (x^5 + x + 1) |
1043 | 1044 | sage: # Remove noisy zero terms: |
1044 | | sage: parent(poly)([ 0.0 if abs(c)<=1e-14 else c for c in poly.coeffs() ]) |
| 1045 | sage: parent(poly)([ 0.0 if abs(c)<=epsilon else c for c in poly.coeffs() ]) |
1045 | 1046 | 1.0 |
1046 | 1047 | sage: f = inverse_mod(x^3 - x + 1, x - 2); f |
1047 | 1048 | 0.142857142857 |
… |
… |
|
1051 | 1052 | -0.0319636125...*x^3 - 0.0383269759...*x^2 - 0.0463050900...*x + 0.346479687... |
1052 | 1053 | sage: poly = f*g % m |
1053 | 1054 | sage: # Remove noisy zero terms: |
1054 | | sage: parent(poly)([ 0.0 if abs(c)<=1e-14 else c for c in poly.coeffs() ]) |
| 1055 | sage: parent(poly)([ 0.0 if abs(c)<=epsilon else c for c in poly.coeffs() ]) |
1055 | 1056 | 1.0 |
1056 | 1057 | |
1057 | 1058 | ALGORITHM: Solve the system as + mt = 1, returning s as the inverse |