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

2018-02-05 Thread Simon King
Hi Ralf, On 2018-02-05, Ralf Stephan wrote: > Argh, we cannot return Unknown from bool() because of Python. Still, we can > avoid calling Maxima for numeric questions: > https://trac.sagemath.org/ticket/24658 > > This is a really tiny ticket and should be easy to review.

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

2018-02-05 Thread Simon King
Hi Vincent, On 2018-02-05, Vincent Delecroix <20100.delecr...@gmail.com> wrote: >> So, here is the example: >> sage: val = pi - 2286635172367940241408/1029347477390786609545*sqrt(2) >> sage: bool(val<0) >> False >> sage: bool(val>0) >> True > > > > [SNIP] > > >> So, is that a bug, after

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

2018-02-05 Thread Ralf Stephan
Argh, we cannot return Unknown from bool() because of Python. Still, we can avoid calling Maxima for numeric questions: https://trac.sagemath.org/ticket/24658 This is a really tiny ticket and should be easy to review. -- You received this message because you are subscribed to the Google Groups

[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
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)

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 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

[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,

[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