Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cygwin: numerical noise in sage/rings/integer.pyx #9172

Closed
williamstein opened this issue Jun 7, 2010 · 12 comments
Closed

cygwin: numerical noise in sage/rings/integer.pyx #9172

williamstein opened this issue Jun 7, 2010 · 12 comments

Comments

@williamstein
Copy link
Contributor


sage -t  "devel/sage/sage/rings/integer.pyx"                
**********************************************************************
File "/home/wstein/sage-4.4.3/devel/sage/sage/rings/integer.pyx", line 1681:
    sage: 2^float(1.5)       # python float
Expected:
    2.8284271247461903
Got:
    2.8284271247461898
**********************************************************************
1 items had failures:
   1 of  26 in __main__.example_42
***Test Failed*** 1 failures.
For whitespace errors, see the file /home/wstein/.sage//tmp/.doctest_integer.py
 [15.2 s]

CC: @jpflori

Component: porting: Cygwin

Reviewer: Jean-Pierre Flori

Issue created by migration from https://trac.sagemath.org/ticket/9172

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Feb 9, 2011

comment:1

The correct answer is 2*sqrt(2), which is 2.8284271247461900976033774484193961...

So the expected value is 2.0239x10-16 high, and result on Cygwin is 2.9760x10-16 low. So the errors on Linux/OSX/Solaris is not much lower than on Cygwin. We can't really expect any more from a floating point number.

We could change the Expected value to 2.8284271247461... What I don't like about that, is then much larger errors can exist and them not be detected. But this is far from the only such case, so I suggest just changing the test to 2.8284271247461..., which will solve this.

Dave

@kcrisman
Copy link
Member

kcrisman commented Aug 2, 2011

comment:2

This file passed doctests on a build of mine on XP.

@kcrisman
Copy link
Member

comment:3

But when doing the test by hand, the same thing happens.

@kcrisman
Copy link
Member

comment:4

This now fails with

2.82842712474619

which I suppose is an improvement. Maybe we can use abs tol?

@jpflori
Copy link

jpflori commented Jan 15, 2013

comment:5

And the test passes for me (64bits W7 + 5.6.rc0).

@kcrisman
Copy link
Member

comment:6

And the test passes for me (64bits W7 + 5.6.rc0).

In which case it might just be a 32-bit versus 64-bit issue. Did you try it by hand as well?

@dimpase
Copy link
Member

dimpase commented Jan 27, 2013

comment:7

Replying to @kcrisman:

And the test passes for me (64bits W7 + 5.6.rc0).

In which case it might just be a 32-bit versus 64-bit issue. Did you try it by hand as well?

works for me, both ways. I think we can close this one.

@kcrisman
Copy link
Member

comment:8

Hmm, I'm reluctant to not just change this a bit for 32-bit...

@jpflori
Copy link

jpflori commented Jan 30, 2013

comment:9

Yeah, I think we should make sure this passes on 32 bits.
I'll double check when I have the time to build on such a computer.

@jpflori
Copy link

jpflori commented Feb 8, 2013

comment:11

I have no problems on my 32 bits Windows 7 install, so Cygwin must have gotten better.
I really doubt Cygwin on XP would have a different behavior for this one, so let's close it.

@jpflori jpflori removed this from the sage-5.7 milestone Feb 8, 2013
@jdemeyer
Copy link

jdemeyer commented Feb 8, 2013

Reviewer: Jean-Pierre Flori

@fchapoton

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants