On Wed, May 23, 2007 at 05:28:29PM -0400, Stavros Macrakis wrote:
> On 5/23/07, Andrej Vodopivec <andrej.vodopivec at gmail.com> wrote:
> >
> >On 5/23/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> >> A big issue in the design is: should nintegrate in fact be a separate
> >> function from integrate?,,,
> >
> >I would prefer to have a separate function for numerical integration.
>
>
> Why? We don't have a separate function for numerical evaluation of sin; why
> should we have a separate function for numerical evaluation of integrals?
I think numerical evaluation of integrals is inherently a much
trickier process than evaluation of simple functions. No one usually
worries about the convergence of sin(x), (we have recently had
problems with evaluation of tanh(x) and soforth, so this isn't a hard
and fast rule).
But generally, the process of numerical integration depends on several
types of things which may not be well specified by a simple
integrate(...) for example, which rules are you using, what are your
error tolerances, what are the stopping conditions, did the rule
detect convergence, is the rule used specially for particular types of
functions and if so, is this one of those types of functions? Does the
rule work with bigfloats, if so, does its convergence improve with
more bigfloat precision....
On a related note, I generally tend to prefer that functions behave in
a manner completely specified by the arguments, but I see your point
about global variables in the interactive case and where we want many
related things to behave the same (such as wanting numerical
integration and numerical root finding and spline interpolation all to
have the same relative stopping error...)
--
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan