Find_root with function



On 11/6/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> quad_qags is sloppily written, and treats non-numerical endpoints as
> zero rather than throwing an error:
>
>    quad_qags(x,x,a,b) => [0,0,21,0]  /* !!! should give an error */

It turns out this behavior is implementation-specific.
quad_qags and friends rely on Lisp to detect errors (and I realize they
should try to do their own error detection), and some varieties
(SBCL, Clisp) complain about the non-numeric arguments but
GCL happily treats them as 0. You have GCL + Maxima, yes?

> It also doesn't throw errors in the standard Maxima way, but returns an
> error code as the 4th element of the list, which makes it easy to ignore
> (your code, for example, doesn't check it). So even if it *had* checked the
> non-numerical endpoint case, your code wouldn't have noticed.

The 4th argument is a diagnostic, which can be interpreted by
looking up the comments in the original Fortran ...
I agree that's obscure at best, but whatever we do (e.g. throw
something if the return code is anything except "OK") I think we
want to preserve the diagnostic in some way.

best

Robert