integrating trig functions with large constants, exponent out of range



Daniel Lakeland wrote:
> On Fri, Jan 05, 2007 at 03:51:45PM -0800, Daniel Lakeland wrote:
>   
>> On Sat, Jan 06, 2007 at 01:10:07AM +0200, Neilen Marais wrote:
>>     
>>> Hi
>>>
>>> I get the following problem:
>>>
>>>       
>>> I tried reducing the error:
>>>
>>> (%i9) integrate(%i*sin(34037595938027*x3)*x3, x3);
>>>
>>> but had to interrupt it since it seemed to take forever. I found that
>>> the integration time is dependent on the size of the constant in the
>>> expression. integrate(%i*sin((3*x3))*x3, x3) happens fast, 
>>> integrate(%i*sin((30000*x3))*x3, x3) takes several seconds etc.
>>>       
>> This executes in no time flat for me on windows stock maxima 5.10.0 in
>> GCL. 
>>
>> ****** It also gives a wrong answer!!! ******
>>
>>     
>
> The debian package 5.10.0-6 on amd64 has the same hanging behavior
> that you see rather than the fast wrong answer.
>
>   
I don't know the real reason, but I suspect it's caused by compiling the
code with safety low enough that gcl doesn't check to see if the result
of multiplication is a fixnum.  At least that's the case with clisp and
cmucl.

For amd64, I assume most-positive-fixnum is close to 64 bits instead of
32, so issue isn't reached, at least as  quickly.

Ray