In article <email@example.com>, David Klein <firstname.lastname@example.org> wrote: >I would like to integrate a function like > >f:=exp(-x^2); > >evalhf(f,x=-infinity..infinity));
Since you said you were trying to integrate the function, I will assume you meant to evaluate
I would suggest you evaluate it as follows:
As you can see, the first step is to evaluate the integral and get an exact, symbolic result. No floating point computations are involved here, and insisting on using floating point will only slow it down and get a less precise answer. The second step, evaluating Pi^(1/2), is the only place where floating point arithmetic is needed.
>but with a more time consuming integrand, f. > >evalf instead of evalhf works, but I am trying to be faster.
If the integral is one that Maple doesn't handle symbolically, then you should try the following:
With this setting of Digits, evalf and evalhf should give similar results, though it is not clear whether the timing will be the same for expressions on which both are applicable. With the simple f := exp(x^2), this method is MUCH slower than symbolic integration.