Exponential integral

Hi all,

does anybody know if there is any TMath function that calculates the exponential integral?

The function to be integrated is exp(-t)/t. The lower integration limit is x (variable), the upper integration limit is +infinity.

In the old cernlibs this function exists (REXPIN - C337), but in TMath I did not find it.

Thanks for your help,
Francesco

This function is provided via GSL in MathMore library. From ROOT
you can do:

root > gSystem->Load("libMathMore"); root > ROOT::Math::expint(1);
see: seal.web.cern.ch/seal/MathLibs/M … bec6a71466

Rene

Hello Rene, thanks for your help.

I installed the GSL and the MathMore libraries in the root lib directory of my machine (using the make install command according to the instructions in the web site) and I tried to run from an interactive root session the code you suggested.

I loaded successfully the library (line 1 of your root code). However, when I try to evaluate the function expint(1) (line 2 of your code), I get the following error message:

Error: Function expint() is not defined in current scope FILE:(tmpfile) LINE:1

Possible candidates are…
filename line:size busy function type and name
*** Interpreter error recovered ***

Did I make any mistake in the installation of the libraries?

Have you done before

using namespace ROOT::Math;

or called the function with

ROOT::Math::expint(1)

Otherwise if it does not work, please tell me the ROOT version and the platform you are using

Lorenzo

[quote=“moneta”]Have you done before

using namespace ROOT::Math;

or called the function with

ROOT::Math::expint(1)

Otherwise if it does not work, please tell me the ROOT version and the platform you are using

Lorenzo[/quote]

I called the function with the command ROOT::Math::expint(1)

Actually I am working with ROOT version 5.10 on a SLC 4.4 x86_64 platform, but I also tried on a Linux Mandrake platform with an older ROOT version 4.

I think I have understood your problem.
You have installed MathMore downloading separatly from the Web.
As written in the Web page :
seal.web.cern.ch/seal/MathLibs/M … index.html

You dont have in this case the CINT dictionary. You can use MathMore as an external C++ library but not interactivly from the ROOT prompt.
If you want to do that, you need to build MathMore using the ROOT build system.

For versions before 5.12, you need to re-configure and build the ROOT mathmore package by doing:

./configure --enable-mathmore
make

From ROOT versions 5.12 a version of GSL (>= 1.5) is first required.
After having installed GSL, you then re-configure ROOT by doing:

./configure --with-gsl-incdir=.......  --with-gsl-libdir=...........
make

I hope my instructions are clear enough. If you still have problems, please let me know,

Cheers

Lorenzo

Thanks for your help, Lorenzo. I solved the problem after installing the version 5.12 of root and now everything is working fine.