"Toshiyuki (Toshi) Meshii" wrote:
>
> Hello,
>
> I have a program written in Mathematica.
> Since It takes long time in calculating NIntegrate, I was wondering whether
> I can translate my program to C-language.
>
> I know there is a command called CForm, but it does not translate NIntegrate
> to an detailed C code.
> Can someone help me on my problem?
>
> -Toshi
I am very curious to know what you think a C translation might do with
NIntegrage. I will point out that NIntegrate itself is implemented in C.
Your best possibilities are
(i) Experiment with different methods and other options that influence
NIntegrate. It may be that the default settings are far from optimal for
the particular quadratures you require. This is especially likely if,
say, the integrand has singularities of some sort in the domain of
integration.
(ii) Use standard commercial or free library code to do the quadrature.
For this I imagine you would need to use MathLink to go between this and
your Mathematica program.
(iii) Determine whether some symbolic preprocessing might be of help.
This is likely in cases where the indefinite integration (or part
thereof, if an iterated integral) can be done symbolically, and there
are no singularities so that Newton-Liebniz rule may then be applied.
Somethimes other sorts of symbolic preprocesing can also help simply by
making subsequent numeric evaluations of the integrand faster, or by
removing cancelling singularities in separate parts of the original
integrand.
If typical NIntegrate calls are not too complicated you might want to
post one, say in Mathematica InputForm.
Daniel Lichtblau
Wolfram Research