In article <email@example.com>, David Klein <firstname.lastname@example.org> wrote: >I would like to integrate a function like
>but with a more time consuming integrand, f.
>evalf instead of evalhf works, but I am trying to be faster.
>I have tried also sorts of methods such as using "Int" instead of >"int", using g:=unapply(f,x) or g:=unapply(evalhf(f,x)) or >g:=evalhf(unapply(f,x)) or g:=x -> evalhf(f). I also tried the above >with combinations of quoting the integrand 'g(x)' or even ''g(x)'' etc...
>Can anyone tell me how to use evalhf as efficiently as possible in >these cases?
As far as I know, this is impossible. In fact, on p. 245 of the Maple V Programming Guide (Release 4) it says "you cannot evaluate an integral using hardware floating-point arithmetic". The problem is that "evalhf" is for arithmetic calculations only, without anything symbolic (including intermediate results). And integration, even numerical integration, does a lot of symbolic processing. Especially in a case like yours involving an improper integral, which Maple tries to transform to a proper integral, e.g. by change of variable. For some insight into what it does, try > infolevel[evalf]:= 5; > evalf(Int(...));
In order to use "evalhf", you'll have to come up with a purely numerical procedure for evaluating your integral, one where all intermediate steps evaluate to floats, and there are no symbolic structures except arrays.
Robert Israel email@example.com Department of Mathematics (604) 822-3629 University of British Columbia fax 822-6074 Vancouver, BC, Canada V6T 1Y4