help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quadl crashes on evaluation


From: Ben Abbott
Subject: Re: quadl crashes on evaluation
Date: Sat, 20 Sep 2008 14:18:07 -0400


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]