summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRelease Manager <release@sagemath.org>2018-07-21 14:53:17 +0200
committerVolker Braun <vbraun.name@gmail.com>2018-07-21 14:53:17 +0200
commitf145828d6243fecbd158f0c7b7345bb3045a2342 (patch)
tree6807d7d060e14ed2c81a54505cb457af19a38621
parentTrac #25814: Upgrade to cysignals 1.7.2 (diff)
parentadjust for minor system-dependent floating point variation on this test; #25815 (diff)
Trac #25815: Floating point accuracy fail in sage.symbolic.expression on Cygwin
Started getting this test failure on Cygwin: {{{ sage -t src/sage/symbolic/expression.pyx ********************************************************************** File "src/sage/symbolic/expression.pyx", line 6843, in sage.symbolic.expression.Expression.polynomial Failed example: f.polynomial(CDF) Expected: (-2.718281828459045)*y^2 + 31.006276680299827*x - 1.0*I Got: (-2.7182818284590455)*y^2 + 31.006276680299827*x - 1.0*I ********************************************************************** File "src/sage/symbolic/expression.pyx", line 6957, in sage.symbolic.expression.Expression._polynomial_ Failed example: R(f) Expected: 2.718281828459045*x^3 + 3.141592653589793*y^3 + 1.414213562373095 + 1.0*I Got: 2.7182818284590455*x^3 + 3.141592653589793*y^3 + 1.414213562373095 + 1.0*I }}} probably as a result of #25247, probably only on Cygwin due to a slight rounding difference in some libc math function. URL: https://trac.sagemath.org/25815 Reported by: embray Ticket author(s): Erik Bray Reviewer(s): Jeroen Demeyer
-rw-r--r--src/sage/symbolic/expression.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
index e9a6737..16a3b79 100644
--- a/src/sage/symbolic/expression.pyx
+++ b/src/sage/symbolic/expression.pyx
@@ -6840,7 +6840,7 @@ cdef class Expression(CommutativeRingElement):
sage: x, y, n = var('x, y, n')
sage: f = pi^3*x - y^2*e - I; f
pi^3*x - y^2*e - I
- sage: f.polynomial(CDF)
+ sage: f.polynomial(CDF) # abs tol 1e-15
(-2.718281828459045)*y^2 + 31.006276680299827*x - 1.0*I
sage: f.polynomial(CC)
(-2.71828182845905)*y^2 + 31.0062766802998*x - 1.00000000000000*I
@@ -6954,7 +6954,7 @@ cdef class Expression(CommutativeRingElement):
sage: f = e*x^3 + pi*y^3 + sqrt(2) + I; f
pi*y^3 + x^3*e + sqrt(2) + I
sage: R = CDF['x,y']
- sage: R(f)
+ sage: R(f) # abs tol 1e-15
2.718281828459045*x^3 + 3.141592653589793*y^3 + 1.414213562373095 + 1.0*I
We coerce to a higher-precision polynomial ring::