sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.47k stars 485 forks source link

numerical noise in variety(RDF) #13980

Open zimmermann6 opened 11 years ago

zimmermann6 commented 11 years ago

Consider the following:

sage: R.<x,y> = QQ[]; J = ideal([ x^7-(100*x-1)^2, y-x^7+1 ]) 
sage: J.variety(RDF)
[{y: 396340.890167, x: 26.612261084}]

On some machines the value of x is completely different (see #11672, comment 14). We should investigate why, since RDF (RealDoubleField) is a wrapper for the double C type, and according to IEEE 754 results should not differ from one combination of architecture/operating-system/compiler to another one.

Paul

Component: basic arithmetic

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

zimmermann6 commented 11 years ago
comment:1

some progress comparing my machine (tarte.loria.fr) with Sage 5.5 and "arando" (thanks Dima) with Sage 5.7.beta0.

On my machine:

----------------------------------------------------------------------
| Sage Version 5.5, Release Date: 2012-12-22                         |
| Type "notebook()" for the browser-based notebook interface.        |
| Type "help()" for help.                                            |
----------------------------------------------------------------------
Loading Sage library. Current Mercurial branch is: 12615b
sage: R.<y> = ZZ[]              
sage: f
y^7 + 1400000000000000*y^4 + 12600000000000000*y^3 - 9999999999966400000000000000*y^2 - 19999999999964800000000000000*y - 9999999999987200000000000000
sage: r = f.roots(ring=RDF)
sage: r
[(396340.890167, 1)]
sage: RR(r[0][0]).exact_rational()
3404542322665677/8589934592

On arando:

----------------------------------------------------------------------
| Sage Version 5.7.beta0, Release Date: 2013-01-21                   |
| Type "notebook()" for the browser-based notebook interface.        |
| Type "help()" for help.                                            |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage: R.<y> = ZZ[]                    
sage: r = f.roots(ring=RDF)
sage: r
[(396340.890167, 1)]
sage: RR(r[0][0]).exact_rational()
1702271161332839/4294967296

Paul