Interesting.  Since this assumption stuff does something in Maxima, perhaps 
that is where the slowdown happens.  I'm not sure that we ask Maxima to 
check for our equality, though perhaps it comes into play once that 
assumption is made.

 

> Hi, 
>
> I know that comparing symbolic expressions of a real variable is generally 
> an undecidable problem, but I've recently faced the following CPU time 
> issue on very simple symbolic expressions:
>
> sage: assume(x, 'real')
> sage: %time bool(exp(512*(x+1)) == 1)
> CPU times: user 4min 46s, sys: 116 ms, total: 4min 46s
> Wall time: 4min 48s
> False
>
> The CPU time actually increases with the factor in front of (x+1):
>
> sage: %time bool(exp(2*(x+1)) == 1)
> CPU times: user 24 ms, sys: 4 ms, total: 28 ms
> Wall time: 23.7 ms
> False
> sage: %time bool(exp(32*(x+1)) == 1)
> CPU times: user 108 ms, sys: 0 ns, total: 108 ms
> Wall time: 105 ms
> False
> sage: %time bool(exp(64*(x+1)) == 1)
> CPU times: user 660 ms, sys: 4 ms, total: 664 ms
> Wall time: 664 ms
> False
> sage: %time bool(exp(128*(x+1)) == 1)
> CPU times: user 4.2 s, sys: 0 ns, total: 4.2 s
> Wall time: 4.23 s
> False
> sage: %time bool(exp(256*(x+1)) == 1)
> CPU times: user 33.9 s, sys: 4 ms, total: 33.9 s
> Wall time: 34.1 s
> False
>
> If x is not assumed to be real, everything is fine: 
>
> sage: forget()
> sage: %time bool(exp(512*(x+1)) == 1)
> CPU times: user 32 ms, sys: 0 ns, total: 32 ms
> Wall time: 31.7 ms
> False
>
> Thanks for your comments / advice on this. 
>
> Eric.
>

-- 
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, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to