bessel.lisp error codes and noisy quad_qagi



On Fri, Nov 11, 2011 at 2:47 PM, Edwin Woollett <woollett at charter.net>wrote:

> On Nov. 11, 2011, Raymond Toy wrote:
> ------------------------------**--------
>
>> ...  finally:
>>>
>>> ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC.
>>> ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED
>>> *  ABNORMAL RETURN
>>> *  ERROR NUMBER = 5
>>> *   ***END OF MESSAGE
>>>
>>> (%o5) [-311.0051190974822,70.****21683385597015,5985,5]
>>>
>>>
>>> Is there a *quieter way* I can  use quad_qagi for this
>>> calculation?
>>>
>>>
>> Right now you get to go and remove the print from bessel-k in
>> src/bessel.lisp. :-(
>>
>> Rather than doing these fixes one at a time, perhaps it's time to
>> consider
>> what maxima should do with these kinds of errors and fix them all at
>> once.
>> I certainly don't want the message to be removed; there needs to be some
>> way to inform the user about issues.  This is what needs to be designed.
>>
>>  ------------------------------**-
> I am relying on the error code (fourth element of returned list)
> returned by quad_qagi to make a decision about what to do next inside
> nint. That's really all the information I need from
> quad_qagi.  The rest of the zbesk ierr = stuff is not needed,
> nor is the final ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC.
> For my purposes, this is noise.
>

I was thinking of slightly bigger picture than your nint.  Right now, that
message is the only way to know that zbesk might not be doing what you
think it is.  There ought to be a way for a program to determine that.

For you particular issue, I also see no reason for quad_qagi to continue
doing any more computations with bogus results from zbesk.  If zbesk could
indicate failure, then quad_qagi could immediately return failure.  That
would be more robust for your purposes.  It's hard to tell if quad_qagi
would return success even if zbesk was completely failing.  Worst case:
zbesk is totally broken and returns 0 for everything.  quad_qagi would
think everything was fine and give a nice "reliable" answer.

Ray