[sage-devel] Bug in positivity test of a real expression

2018-02-04 Thread Simon King
Hi! I found this sage: val = SR(-5.68242325601396e-24) sage: bool(val>0) False sage: bool(val<0) True sage: RR(val)>0 False sage: RR(val)<0 True I am not so familiar with the symbolic ring, thus, I don't know if it is a known bug or not. If you tell me that you don't recognise the bug

Re: [sage-devel] Bug in positivity test of a real expression

2018-02-04 Thread Thierry
Hi, On Sun, Feb 04, 2018 at 10:24:55PM +, Simon King wrote: > Hi! > > I found this > > sage: val = SR(-5.68242325601396e-24) > sage: bool(val>0) > False > sage: bool(val<0) > True > sage: RR(val)>0 > False > sage: RR(val)<0 > True What is wrong ? Ciao, Thierry > I am not so

[sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Simon King
On 2018-02-04, Simon King wrote: > On 2018-02-04, Thierry wrote: >> On Sun, Feb 04, 2018 at 10:24:55PM +, Simon King wrote: >> What is wrong ? > > val is a NEGATIVE real number converted into SR. val evaluates POSITIVE, > even though

[sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Simon King
On 2018-02-04, Thierry wrote: > On Sun, Feb 04, 2018 at 10:24:55PM +, Simon King wrote: > What is wrong ? val is a NEGATIVE real number converted into SR. val evaluates POSITIVE, even though the conversion of val into RR still evaluates negative. -- You

[sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Simon King
Hi Ralph, On 2018-02-05, Ralf Stephan wrote: > With bool(val<0) ultimately (val<0).test_relation() is called which does: > > sage: RIF(val) > 0.?e-15 > sage: RIF(val) < 0 > False I could understand if BOTH val>0 and val<0 evaluated to False, as val is almost zero. However, if

Re: [sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Vincent Delecroix
Hi Simon, On 04/02/2018 23:59, Simon King wrote: On 2018-02-04, Simon King wrote: On 2018-02-04, Thierry wrote: On Sun, Feb 04, 2018 at 10:24:55PM +, Simon King wrote: What is wrong ? val is a NEGATIVE real number converted into

[sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Ralf Stephan
Actually Sage's logic is fine here, the bug with bool(val>0) is in Maxima.The default with bool(relation) is to use RIF and at the default setting it cannot decide, so ultimately Maxima is called: (%i2) is (%pi-(1116521080257783321*2^(23/2))/1029347477390786609545>0); (%o2)

[sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Ralf Stephan
I think we should refrain from calling Maxima with bool(...) because our tests are good enough. Moreover with https://trac.sagemath.org/ticket/24345 we could then simply return Unknown. Please review. On Monday, February 5, 2018 at 8:12:49 AM UTC+1, Ralf Stephan wrote: > > Actually Sage's logic

[sage-devel] Re: Bug in positivity test of a real expression

2018-02-04 Thread Ralf Stephan
With bool(val<0) ultimately (val<0).test_relation() is called which does: sage: RIF(val) 0.?e-15 sage: RIF(val) < 0 False Regards. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it,