quadl crashes on evaluation
Ben Abbott
bpabbott at mac.com
Sat Sep 20 14:09:04 CDT 2008
On Sep 20, 2008, at 2:18 PM, Ben Abbott wrote:
>
> On Sep 20, 2008, at 1:07 PM, rmcd wrote:
>>
>> David Bateman-3 wrote:
>>>
>>> It shouldn't crash as the issue here is only that the recursion
>>> limit of
>>> Octave is met. I suspect that cygwin doesn't like a 256 deep
>>> recursion
>>> as set by default with Octave and you should try something like
>>>
>>> max_recursion_depth (128)
>>> quadl (@(x) x .* sin (1 ./ x) .* sqrt (abs (1 - x)), 0, 3)
>>>
>>> and see if it still crashes. If it doesn't, I'd suggest that the
>>> cygwin
>>> maximum recursion depth be reduced.
>>>
>>
>> You're correct. Octave does not crash if I set max_recursion_depth
>> to 128.
>>
>> If I could ask another question about this example, the first time I
>> call
>> quadl I get the following errors (this doesn't happen with quad and
>> only the
>> first time with quadl):
>>
>> octave:1> quadl ("f",0,3)
>> error: `x' undefined near line 2 column 5
>> error: evaluating binary operator `.*' near line 2, column 7
>> error: evaluating binary operator `.*' near line 2, column 23
>> error: evaluating assignment expression near line 2, column 3
>> error: called from `f' in file `/cygdrive/d/progdata/matlab/rmcd/
>> test/f.m'
>> error: evaluating argument list element number 1
>> error: evaluating assignment expression near line 126, column 5
>> error: called from `quadl' in file
>> `/usr/share/octave/3.0.2/m/general/quadl.m'
>>
>> The function file looks like this:
>>
>> function y = f (x)
>> y = x .* sin (1 ./ x) .* sqrt (abs (1 - x));
>> endfunction
>>
>> It seems to be some kind of initialization error. Not a big deal,
>> but I'm
>> curious.
>
> I'm able to run 3.0.1 and 3.1.51 (developers sources).
>
> I don't see this error in either.
>
> What happens when you include the "eps" and the tolerance
>
>> function y = f (x)
>> y = x .* sin (1 ./ (x+eps)) .* sqrt (abs (1 - x));
>> endfunction
>
> quadl ("f", 0, 3, 0.0001)
>
> If still present, what of
>
> quadl (@f, 0, 3, 0.0001)
>
> Ben
I installed 3.0.2 as well, and get the same error as reported by rmcd
the fist time I call quadl('f' ,0, 3, .0001).
If I call quadl(@f, 0, 3, 0.0001), then there is no error.
In order to run 3.0.2 and 3.0.1 I had to reinstall 3.0.1 as well. I
get the same result with each, but 3.1.51 does not give the error.
Ben
More information about the Help-octave
mailing list