Problem with Gamma function

Please provide the following information:


ROOT Version (e.g. 6.12/02):
Platform, compiler (e.g. CentOS 7.3, gcc6.2):


ROOT Version: 6.10/00
compiler: gcc (Ubuntu 4.8.5-4ubuntu6) 4.8.5

Hello!
I am having problems to use the gamma function. This is the definition of my TF1:

TF1 *einas = new TF1("einas", "( 7.19*pow(10,-7)*TMath::inc_gamma_c(11.7647, 13.3185*pow( (pow(x,2)-16*x*[0] + 64), 0.085) )/x", -500, 500);

And at some point of the code I am doing the following integral:

einasi[i] = einas->Integral(10, 16);

but I receive the error: TMath::inc_gamma_c is unknown.

However, the definition of this function can be found in tthis link:

https://root.cern.ch/doc/v606/group__SpecFunc.html

does anyone know why root is not recognizing the function?

Thank you

Maybe @moneta can give more details, but could you try with:

TF1 einas = new TF1(β€œeinas”, "( 7.19pow(10,-7)ROOT::Math::inc_gamma_c(11.7647, 13.3185pow( (pow(x,2)-16x[0] + 64), 0.085) )/x", -500, 500);

7.19pow(10,-7)

is not a valid expression. You probably mean

7.19*pow(10,-7)

Lorenzo

As @bellenot points out, in the original formula, one needs to change TMath into ROOT::Math. Also, a β€œ)” is missing right before or right after the final β€œ/x”, or the very first β€œ(” should be removed.

1 Like

You can copy/paste this one:

root [0] TF1 *einas = new TF1("einas", "7.19*pow(10,-7)*ROOT::Math::inc_gamma_c(11.7647, 13.3185*pow( (pow(x,2)-16*x*[0] + 64), 0.085) )/x", -500, 500);
root [1] 

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.