Integrating funtion past its range

Hello,

this makro

{

TF1 *fun=(TF1*) gROOT->GetFunction("gaus");
fun->SetRange(-100, 100);
fun->SetNpx(1000);
fun->SetParameters(0.39894228, 0, 1);
cout<<fun->Integral(-40, 40)<<endl;
cout<<fun->Integral(-50, 50)<<endl;
cout<<fun->Integral(-60,60)<<endl;
cout<<fun->Integral(-70,70)<<endl;

}

produces the following output:

Processing int_test.Cm…
1
1
7.95454e-07
2.62549e-09

in principal all 4 outputs should be 1.

Is there a general problem with enlarging the range of a funktion (the original rande is -1 to 1)?

Greetings

Felix

Hi Felix,

The default relative precision “epsilon” is 1e-6. If you set it to, eg 1e-12
the result will be correct. I have modified the default value in the CVS version from 1e-6 to 1e-12. see below

Rene

TF1 fun=(TF1) gROOT->GetFunction(“gaus”);
fun->SetRange(-100, 100);
fun->SetNpx(10000);
fun->SetParameters(0.39894228, 0, 1);
cout<Integral(-40, 40)<<endl;
cout<Integral(-50, 50)<<endl;
cout<Integral(-60,60)<<endl; //OK with the CVS version
cout<Integral(-70,69)<<endl; //OK with the CVS version
cout<Integral(-60,60,(double*)0,1e-12)<<endl;
cout<Integral(-70,69,(double*)0,1e-12)<<endl;